summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2017-06-13 21:48:30 +0200
committerArne Schwabe <arne@rfc2549.org>2017-06-13 21:48:30 +0200
commite997cda17a1365c7003875d494a8c05761d16d58 (patch)
treeba843fcdaceda85f40b603553079ffc77921b33f /main
parentf7b199346cbb4c5e2a5fc54c7ac3b8929534f1dd (diff)
If we use floats don't round to nearest integer
Diffstat (limited to 'main')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java2
1 files changed, 1 insertions, 1 deletions
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) {