Saner types.
This commit is contained in:
parent
b1f66d086a
commit
5ef2502b4f
|
@ -408,12 +408,12 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, C
|
||||||
if (duration == 0) {
|
if (duration == 0) {
|
||||||
createCarb(carbsAfterConstraints, time);
|
createCarb(carbsAfterConstraints, time);
|
||||||
} else {
|
} else {
|
||||||
double remainingCarbs = carbsAfterConstraints;
|
long remainingCarbs = carbsAfterConstraints;
|
||||||
long carbTime = time;
|
long carbTime = time;
|
||||||
long smallCarbAmount = Math.round(remainingCarbs / (editDuration.getValue() * 4));
|
long smallCarbAmount = Math.round(remainingCarbs / (editDuration.getValue() * 4));
|
||||||
if (smallCarbAmount == 0) smallCarbAmount = 1;
|
if (smallCarbAmount == 0) smallCarbAmount = 1;
|
||||||
while (remainingCarbs > 0) {
|
while (remainingCarbs > 0) {
|
||||||
createCarb(Math.min(smallCarbAmount, (long) remainingCarbs), carbTime);
|
createCarb(Math.min(smallCarbAmount, remainingCarbs), carbTime);
|
||||||
remainingCarbs -= smallCarbAmount;
|
remainingCarbs -= smallCarbAmount;
|
||||||
carbTime += 15 * 60 * 1000;
|
carbTime += 15 * 60 * 1000;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue