gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 17/32: currency formatter


From: gnunet
Subject: [taler-taler-ios] 17/32: currency formatter
Date: Sat, 10 Feb 2024 15:04:43 +0100

This is an automated email from the git hooks/post-receive script.

marc-stibane pushed a commit to branch master
in repository taler-ios.

commit c828ee8414fa3040d42c539687e123f438f80b9f
Author: Marc Stibane <marc@taler.net>
AuthorDate: Sun Feb 4 15:23:55 2024 +0100

    currency formatter
---
 TalerWallet1/Views/HelperViews/QRCodeDetailView.swift | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift 
b/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
index 0a2dcfc..14adf50 100644
--- a/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
+++ b/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
@@ -12,6 +12,15 @@ struct QRCodeDetailView: View {
     let incoming: Bool
     let amount: Amount
 
+    @EnvironmentObject private var controller: Controller
+
+    var amountStr: String {
+        if let currencyInfo = controller.info(for: amount.currencyStr) {
+            return amount.string(currencyInfo)
+        }
+        return amount.readableDescription
+    }
+
     var body: some View {
         if talerURI.count > 10 {
             Section {
@@ -42,7 +51,6 @@ struct QRCodeDetailView: View {
                 }
                 .listRowSeparator(.hidden)
 
-                let amountStr = amount.readableDescription       // TODO: 
currency formatter?
                 let hintStr = incoming ? String(localized: "let the payer scan 
this QR code to pay \(amountStr).",
                                                   comment: "e.g. '5,3 €'")
                                        : String(localized: "let the payee scan 
this QR code to receive \(amountStr).",

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]