From dce0c378b95a2e76c2ccbd04318bb7b3ac60dc55 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Mon, 30 Jan 2017 05:02:49 +0100 Subject: [PATCH] round durations --- .../main/java/info/nightscout/androidaps/db/TempBasal.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/db/TempBasal.java b/app/src/main/java/info/nightscout/androidaps/db/TempBasal.java index fa99118bca..99389777d5 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/TempBasal.java +++ b/app/src/main/java/info/nightscout/androidaps/db/TempBasal.java @@ -131,7 +131,7 @@ public class TempBasal { public int getRealDuration() { Long msecs = getTimeEnd().getTime() - timeStart.getTime(); - return (int) (msecs / 60 / 1000); + return Math.round(msecs / 60f / 1000); } public long getMillisecondsFromStart() { @@ -140,8 +140,8 @@ public class TempBasal { public int getPlannedRemainingMinutes() { if (timeEnd != null) return 0; - long remainingMin = (getPlannedTimeEnd().getTime() - new Date().getTime()) / 1000 / 60; - return (remainingMin < 0) ? 0 : (int) remainingMin; + float remainingMin = (getPlannedTimeEnd().getTime() - new Date().getTime()) / 1000f / 60; + return (remainingMin < 0) ? 0 : Math.round(remainingMin); } public boolean isInProgress() {