commit 46455cc624e8e8c99fd5894ade1616e067ec2385
parent 52e957693e02115827b8ecb234b9c75e313cb755
Author: Marc Stibane <marc@taler.net>
Date: Sat, 14 Feb 2026 10:53:37 +0100
limit ヌ for NULL currency
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/TalerWallet1/Helper/CurrencySpecification.swift b/TalerWallet1/Helper/CurrencySpecification.swift
@@ -110,14 +110,16 @@ public struct CurrencyInfo: Sendable {
let formatter: CurrencyFormatter
// public static func zero(_ currency: String) -> CurrencyInfo {
- public static func zero(_ currency: String) -> CurrencyInfo {
+ public static func zero(_ currency: String, nu: Bool = false) -> CurrencyInfo {
+ let null = nu ? "ヌ" // use `nu´ for Null
+ : EMPTYSTRING
let specs = CurrencySpecification(name: currency,
currency: currency,
commonAmounts: nil,
fractionalInputDigits: 0,
fractionalNormalDigits: 0,
fractionalTrailingZeroDigits: 0,
- altUnitNames: [0 : "ヌ"]) // use `nu´ for Null
+ altUnitNames: [0 : null])
let formatter = CurrencyFormatter.formatter(currency: currency, specs: specs)
return CurrencyInfo(specs: specs, formatter: formatter)
}
@@ -163,6 +165,7 @@ public struct CurrencyInfo: Sendable {
}
return false
}
+ var commonAmounts: [Amount]? { specs.commonAmounts }
/// returns all characters left from the decimalSeparator
func integerPartStr(_ integerStr: String, decimalSeparator: String) -> String {