We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f6efe7 commit 56cecedCopy full SHA for 56ceced
WatchApp Extension/Views/Carb Entry & Bolus/BolusInput.swift
@@ -102,10 +102,10 @@ fileprivate extension Collection where Element == Decimal {
102
/// - Precondition: The collection is sorted in ascending order.
103
func deltaScale(boundedBy maxScale: Int) -> Int {
104
let roundedToMaxScale = lazy.map { $0.rounded(toPlaces: maxScale) }
105
- guard let maxDelta = roundedToMaxScale.adjacentPairs().map(-).map(abs).max() else {
+ guard let minDelta = roundedToMaxScale.adjacentPairs().map(-).map(abs).min() else {
106
return 0
107
}
108
109
- return abs(Swift.min(maxDelta.exponent, 0))
+ return abs(Swift.min(minDelta.exponent, 0))
110
111
0 commit comments