gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 05/07: Currency Symbol


From: gnunet
Subject: [taler-taler-ios] 05/07: Currency Symbol
Date: Thu, 26 Oct 2023 13:21:31 +0200

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 3a8281d21ab537309bacc0b44266c647fec8e3a0
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Oct 26 13:13:23 2023 +0200

    Currency Symbol
---
 TalerWallet1/Helper/CurrencySpecification.swift | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/TalerWallet1/Helper/CurrencySpecification.swift 
b/TalerWallet1/Helper/CurrencySpecification.swift
index cbbefc1..9adff4b 100644
--- a/TalerWallet1/Helper/CurrencySpecification.swift
+++ b/TalerWallet1/Helper/CurrencySpecification.swift
@@ -27,6 +27,15 @@ public struct CurrencyInfo {
         }
     }
 
+    func symbol() -> String? {
+        if formatter.hasAltUnitName0 {
+            if let symbol = specs.altUnitNames?[0] {
+                return symbol
+            }
+        }
+        return nil
+    }
+
     func string(for valueTuple: (Double, Double), useSymbol: Bool = true) -> 
String {
         formatter.setUseSymbol(useSymbol)
         let (integer, fraction) = valueTuple
@@ -70,10 +79,8 @@ public struct CurrencyInfo {
         // we need to format ourselves
         var currencyName = scope.currency
         if useSymbol {
-            if formatter.hasAltUnitName0 {
-                if let symbol = specs.altUnitNames?[0] {
-                    currencyName = symbol
-                }
+            if let symbol = symbol() {
+                currencyName = symbol
             }
         }
         var madeUpStr = currencyName + " " + String(integer)

-- 
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]