fix: recognize yen in currency conversions

This commit is contained in:
2026-10-22 14:04:29 +02:00
parent 751f22f6b1
commit 0a85d21801
3 changed files with 19 additions and 0 deletions
+1
View File
@@ -105,6 +105,7 @@ public enum Calculator {
private static func currencyCode(_ text: String, rates: CurrencyRates?) -> String? {
let code = text.lowercased()
if code == "yen" { return "jpy" }
guard (2...12).contains(code.utf8.count),
code.utf8.allSatisfy({ (97...122).contains($0) || (48...57).contains($0) }),
ConversionUnit.parse(text) == nil else { return nil }