[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 09/36: cleanup, zero
From: |
gnunet |
Subject: |
[taler-taler-ios] 09/36: cleanup, zero |
Date: |
Mon, 13 Nov 2023 21:27:14 +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 9ce01d591c46a9b3f0377b1bc6b70154529a8fd7
Author: Marc Stibane <marc@taler.net>
AuthorDate: Sun Nov 12 11:07:30 2023 +0100
cleanup, zero
---
TalerWallet1/Helper/CurrencySpecification.swift | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/TalerWallet1/Helper/CurrencySpecification.swift
b/TalerWallet1/Helper/CurrencySpecification.swift
index 63988e3..01699cf 100644
--- a/TalerWallet1/Helper/CurrencySpecification.swift
+++ b/TalerWallet1/Helper/CurrencySpecification.swift
@@ -20,6 +20,18 @@ public struct CurrencyInfo {
let specs: CurrencySpecification
let formatter: CurrencyFormatter
+ public static func zero(_ currency: String) -> CurrencyInfo {
+ let scope = ScopeInfo(type: .global, currency: currency)
+ let specs = CurrencySpecification(name: currency,
+ fractionalInputDigits: 0,
+ fractionalNormalDigits: 0,
+ fractionalTrailingZeroDigits: 0,
+ altUnitNames: [0 : "テ"])
+ return CurrencyInfo(scope: scope, specs: specs,
+ formatter: CurrencyFormatter.formatter(scope: scope,
+ specs: specs))
+ }
+
/// returns all characters left from the decimalSeparator
func integerPartStr(_ integerStr: String, decimalSeparator: String) ->
String {
if let integerIndex = integerStr.endIndex(of: decimalSeparator) {
@@ -119,18 +131,12 @@ public struct CurrencySpecification: Codable, Sendable {
}
/// some name for this CurrencySpecification
let name: String
- /// e.g. “.” for $, and “,” for €
-// let decimalSeparator: String taken from Locale.current
- /// e.g. “,” for $, and “.” or “ ” for € (France uses a narrow space
character, Hungaria a normal one)
-// let groupSeparator: String? taken from Locale.current
/// how much digits the user may enter after the decimal separator
let fractionalInputDigits: Int
/// €,$,£: 2; some arabic currencies: 3, ¥: 0
let fractionalNormalDigits: Int
/// usually same as numFractionalNormalDigits, but e.g. might be 2 for ¥
let fractionalTrailingZeroDigits: Int
- /// true for “$ 3.50”; false for “3,50 €”
-// let isCurrencyNameLeading: Bool
/// map of powers of 10 to alternative currency names / symbols
/// must always have an entry under "0" that defines the base name
/// e.g. "0 => €" or "3 => k€". For BTC, would be "0 => BTC, -3 => mBTC".
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 27/36: Debugging, (continued)
- [taler-taler-ios] 27/36: Debugging, gnunet, 2023/11/13
- [taler-taler-ios] 30/36: Bugfix, gnunet, 2023/11/13
- [taler-taler-ios] 12/36: DD51 Currency rendering, gnunet, 2023/11/13
- [taler-taler-ios] 24/36: Exchange needs Balance for Deposit, gnunet, 2023/11/13
- [taler-taler-ios] 21/36: amountToTransfer Send, gnunet, 2023/11/13
- [taler-taler-ios] 07/36: Amount(currency:cent:), gnunet, 2023/11/13
- [taler-taler-ios] 06/36: RequestPurpose, gnunet, 2023/11/13
- [taler-taler-ios] 01/36: Startup Chime, gnunet, 2023/11/13
- [taler-taler-ios] 18/36: amountToTransfer Transactions, gnunet, 2023/11/13
- [taler-taler-ios] 17/36: amountToTransfer Balances, gnunet, 2023/11/13
- [taler-taler-ios] 09/36: cleanup, zero,
gnunet <=
- [taler-taler-ios] 29/36: less logging, gnunet, 2023/11/13
- [taler-taler-ios] 13/36: once at very first startup, gnunet, 2023/11/13
- [taler-taler-ios] 15/36: About with explicit link to taler.net, gnunet, 2023/11/13
- [taler-taler-ios] 28/36: Cleanup property wrappers, gnunet, 2023/11/13
- [taler-taler-ios] 22/36: amountToTransfer ManualWithdraw, gnunet, 2023/11/13
- [taler-taler-ios] 33/36: Announce shouldn't change screen, gnunet, 2023/11/13
- [taler-taler-ios] 34/36: Previews, gnunet, 2023/11/13
- [taler-taler-ios] 32/36: Shortcuts (50,25,10,5), gnunet, 2023/11/13
- [taler-taler-ios] 11/36: Debugging, gnunet, 2023/11/13
- [taler-taler-ios] 25/36: amountToTransfer Currency, gnunet, 2023/11/13