[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.
- [taler-taler-ios] branch master updated (686fcd4 -> 9f7de5c), gnunet, 2023/10/26
- [taler-taler-ios] 02/07: Adjust volume for payment sounds, gnunet, 2023/10/26
- [taler-taler-ios] 05/07: Currency Symbol,
gnunet <=
- [taler-taler-ios] 07/07: Bump version to 0.9.3 (22), gnunet, 2023/10/26
- [taler-taler-ios] 03/07: Accessibility: QR, Date, gnunet, 2023/10/26
- [taler-taler-ios] 01/07: Different Icon for Taler Wallet, gnunet, 2023/10/26
- [taler-taler-ios] 04/07: Abbreviations, gnunet, 2023/10/26
- [taler-taler-ios] 06/07: Fixed Balances layout for dynamic font sizes (Previews work again), gnunet, 2023/10/26