taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit 78157b355e5bfa33df3bbbdb3e0658ab0d37ece0
parent a2df784dd3b07bc715b58c6d83387a6342bfc3f1
Author: Marc Stibane <marc@taler.net>
Date:   Wed,  8 May 2024 22:10:33 +0200

non-breaking space

Diffstat:
MTalerWallet1/Controllers/PublicConstants.swift | 1+
MTalerWallet1/Helper/TalerStrings.swift | 2+-
Mtaler-swift/Sources/taler-swift/Amount.swift | 5+++--
3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/TalerWallet1/Controllers/PublicConstants.swift b/TalerWallet1/Controllers/PublicConstants.swift @@ -16,6 +16,7 @@ public let SEVENDAYS: UInt = 7 // 3..9 public let THIRTYDAYS: UInt = 30 // 10..30 public let EMPTYSTRING = "" // avoid automatic translation of empty "" textLiterals in Text() +public let NONBREAKING = "\u{00A0}" public let CONFIRM_BANK = "circle.fill" // badge in PendingRow, TransactionRow and TransactionSummary public let NEEDS_KYC = "star.fill" // badge in PendingRow, TransactionRow and TransactionSummary public let PENDING_INCOMING = "plus.diamond" diff --git a/TalerWallet1/Helper/TalerStrings.swift b/TalerWallet1/Helper/TalerStrings.swift @@ -47,7 +47,7 @@ extension String { } func nbs() -> String { - self.replacingOccurrences(of: " ", with: "\u{00A0}") + self.replacingOccurrences(of: " ", with: NONBREAKING) } func tabbed(oneLine: Bool) -> String { diff --git a/taler-swift/Sources/taler-swift/Amount.swift b/taler-swift/Sources/taler-swift/Amount.swift @@ -182,9 +182,10 @@ public final class Amount: Codable, Hashable, @unchecked Sendable, CustomStringC "\(currency):\(valueStr)" } - /// The string representation of the amount, formatted as "`integer`.`fraction` `currency`" (with space). + /// The string representation of the amount, formatted as "`integer`.`fraction` `currency`" (with non-breaking space). public var readableDescription: String { - "\(valueStr) \(currency)" + let NONBREAKING = "\u{00A0}" + return valueStr + NONBREAKING + currency } /// Whether the value is valid. An amount is valid if and only if the currency is not empty and the value is less than the maximum allowed value.