From c5f2abfe07b3b50a68d6ea33638406c567a1023d Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 8 Feb 2016 12:22:05 +0100 Subject: [PATCH] Use Math.round() instead of cast for device percentage (fixes #197). --- .../java/com/nutomic/syncthingandroid/syncthing/RestApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java b/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java index 3c033671..ffefd437 100644 --- a/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java +++ b/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java @@ -620,7 +620,7 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener, } } return (folderCount != 0) - ? (int) percentageSum / folderCount + ? Math.round(percentageSum / folderCount) : 100; }