瀏覽代碼

Update the IoB netBasalAmount calculation rounding to jsRounding

Sam King 5 月之前
父節點
當前提交
03fe3a7c44

+ 1 - 1
Trio/Sources/APS/OpenAPSSwift/Iob/IobHistory.swift

@@ -423,7 +423,7 @@ struct IobHistory {
         let netBasalRate = tempBasalRate - currentRate
         let netBasalRate = tempBasalRate - currentRate
         let tempBolusSize: Decimal = netBasalRate < 0 ? -0.05 : 0.05
         let tempBolusSize: Decimal = netBasalRate < 0 ? -0.05 : 0.05
 
 
-        let netBasalAmountTmp = (netBasalRate * duration * 10 / 6).rounded()
+        let netBasalAmountTmp = (netBasalRate * duration * 10 / 6).jsRounded()
         let netBasalAmount = netBasalAmountTmp / Decimal(100)
         let netBasalAmount = netBasalAmountTmp / Decimal(100)
         // FIXME: I think the count should be floor not rounded due to pump implementation artifacts
         // FIXME: I think the count should be floor not rounded due to pump implementation artifacts
         let tempBolusCount = Int((netBasalAmount / tempBolusSize).rounded())
         let tempBolusCount = Int((netBasalAmount / tempBolusSize).rounded())

文件差異過大導致無法顯示
+ 1 - 1
TrioTests/OpenAPSSwiftTests/javascript/bundle/autosens.js


文件差異過大導致無法顯示
+ 1 - 1
TrioTests/OpenAPSSwiftTests/javascript/bundle/autotune-prep.js


文件差異過大導致無法顯示
+ 1 - 1
TrioTests/OpenAPSSwiftTests/javascript/bundle/iob-history.js


文件差異過大導致無法顯示
+ 1 - 1
TrioTests/OpenAPSSwiftTests/javascript/bundle/iob.js


文件差異過大導致無法顯示
+ 1 - 1
TrioTests/OpenAPSSwiftTests/javascript/bundle/meal.js