From 5ef2502b4f461783d50ab627c9e64557cc706a39 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Thu, 12 Apr 2018 00:50:28 +0200 Subject: [PATCH] Saner types. --- .../androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java index 8bd7c98f88..ef12b1ca0f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java @@ -408,12 +408,12 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, C if (duration == 0) { createCarb(carbsAfterConstraints, time); } else { - double remainingCarbs = carbsAfterConstraints; + long remainingCarbs = carbsAfterConstraints; long carbTime = time; long smallCarbAmount = Math.round(remainingCarbs / (editDuration.getValue() * 4)); if (smallCarbAmount == 0) smallCarbAmount = 1; while (remainingCarbs > 0) { - createCarb(Math.min(smallCarbAmount, (long) remainingCarbs), carbTime); + createCarb(Math.min(smallCarbAmount, remainingCarbs), carbTime); remainingCarbs -= smallCarbAmount; carbTime += 15 * 60 * 1000; }