diff options
author | Arne Schwabe <arne@rfc2549.org> | 2017-06-13 21:48:30 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2017-06-13 21:48:30 +0200 |
commit | e997cda17a1365c7003875d494a8c05761d16d58 (patch) | |
tree | ba843fcdaceda85f40b603553079ffc77921b33f /main | |
parent | f7b199346cbb4c5e2a5fc54c7ac3b8929534f1dd (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.java | 2 |
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) { |