Improve formatting of numbers by adding grouping separators and limiting the number of fractional digits

This commit is contained in:
2025-03-30 09:47:00 -04:00
parent 5cd4d9189b
commit 82dbf16466
4 changed files with 176 additions and 69 deletions

View File

@@ -33,17 +33,6 @@ public struct ContentView: View {
)
}
public func selectedCurrencyBinding(_ currency: Locale.Currency) -> Binding<String> {
Binding(
get: {
satsViewModel.currencyValueStrings[currency, default: ""]
},
set: { priceString in
satsViewModel.currencyValueStrings[currency] = priceString
}
)
}
public var body: some View {
NavigationStack {
Form {
@@ -96,7 +85,7 @@ public struct ContentView: View {
}
} footer: {
if satsViewModel.exceedsMaximum {
Text("21000000 BTC is the maximum.")
Text("\(SatsViewModel.MAXIMUM_BTC.formatBTCString()) BTC is the maximum.")
}
}