From e5eb3b4c33695247e36b2f5805e06f9119bd9f84 Mon Sep 17 00:00:00 2001 From: "bastiaan.verhaar" Date: Mon, 16 Dec 2024 19:52:57 +0100 Subject: [PATCH] fix(#961): Fix decimal conversion of specific values like .14, .28 etc --- FreeAPS/Sources/Models/BasalProfileEntry.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FreeAPS/Sources/Models/BasalProfileEntry.swift b/FreeAPS/Sources/Models/BasalProfileEntry.swift index 2ce1918f26..236ceecc99 100644 --- a/FreeAPS/Sources/Models/BasalProfileEntry.swift +++ b/FreeAPS/Sources/Models/BasalProfileEntry.swift @@ -21,7 +21,7 @@ extension BasalProfileEntry { let container = try decoder.container(keyedBy: CodingKeys.self) let start = try container.decode(String.self, forKey: .start) let minutes = try container.decode(Int.self, forKey: .minutes) - let rate = try container.decode(Double.self, forKey: .rate).decimal ?? .zero + let rate = try Decimal(floatLiteral: container.decode(Double.self, forKey: .rate)) self = BasalProfileEntry(start: start, minutes: minutes, rate: rate) }