This commit is contained in:
cdricms
2025-12-06 16:33:17 +01:00
parent 7be99711e1
commit 043de16a16
31 changed files with 594 additions and 1674 deletions

View File

@@ -0,0 +1,11 @@
extension KeyedDecodingContainer {
public func decodeFloatOrString(forKey key: Key) throws -> Float? {
if let floatVal = try? decode(Float.self, forKey: key) {
return floatVal
}
if let stringVal = try? decode(String.self, forKey: key) {
return Float(stringVal)
}
return nil
}
}