From e997cda17a1365c7003875d494a8c05761d16d58 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 13 Jun 2017 21:48:30 +0200 Subject: If we use floats don't round to nearest integer --- main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java index 5b90bcc8..d3066fc0 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -127,7 +127,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac int exp = Math.max(0, Math.min((int) (Math.log(bytes) / Math.log(unit)), 3)); - float bytesUnit = Math.round(bytes / Math.pow(unit, exp)); + float bytesUnit = (float) (bytes / Math.pow(unit, exp)); if (speed) switch (exp) { -- cgit v1.2.3