commit a34da741382631477457ee005fce97ae46544be5
parent a58f2d9b9369cf2e3e64081ca92cc71fd717694e
Author: Marc Stibane <marc@taler.net>
Date: Thu, 25 Jul 2024 13:47:07 +0200
Pass in currencyInfo
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/TalerWallet1/Views/HelperViews/AmountV.swift b/TalerWallet1/Views/HelperViews/AmountV.swift
@@ -10,6 +10,7 @@ import taler_swift
struct AmountV: View {
let stack: CallStack?
+ let currencyInfo: CurrencyInfo
let amount: Amount
let isNegative: Bool // if true, show a "-" before the amount
let large: Bool // set to false for QR or IBAN
@@ -17,7 +18,7 @@ struct AmountV: View {
@EnvironmentObject private var controller: Controller
var body: some View {
- Text(amount.formatted(isNegative: isNegative))
+ Text(amount.formatted(currencyInfo, isNegative: isNegative))
.multilineTextAlignment(.center)
.talerFont(large ? .title : .title2)
// .fontWeight(large ? .medium : .regular) // @available(iOS 16.0, *)
@@ -26,8 +27,9 @@ struct AmountV: View {
}
}
extension AmountV {
- init(_ amount: Amount, isNegative: Bool) {
+ init(_ currencyInfo: CurrencyInfo, _ amount: Amount, isNegative: Bool) {
self.stack = nil
+ self.currencyInfo = currencyInfo
self.amount = amount
self.isNegative = isNegative
self.large = false