From d3633cc0c7e7e459e90759cccb95a3fb25dff5dc Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 1 Sep 2021 15:16:31 -0300 Subject: [PATCH] Refine payments formatting. --- SignalMessaging/Payments/PaymentsFormat.swift | 12 ++++++++++-- SignalMessaging/Payments/PaymentsImpl.swift | 1 - 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/SignalMessaging/Payments/PaymentsFormat.swift b/SignalMessaging/Payments/PaymentsFormat.swift index 839bd6a563..9a91f6859c 100644 --- a/SignalMessaging/Payments/PaymentsFormat.swift +++ b/SignalMessaging/Payments/PaymentsFormat.swift @@ -35,9 +35,17 @@ public extension PaymentsFormat { return numberFormatter } + private static let mobFormatShort: NumberFormatter = { + buildMobFormatter(isShortForm: true) + }() + + private static let mobFormatLong: NumberFormatter = { + buildMobFormatter(isShortForm: false) + }() + // Used for formatting MOB (not picoMob) values for display. - private static func mobFormat(isShortForm: Bool, locale: Locale? = nil) -> NumberFormatter { - buildMobFormatter(isShortForm: isShortForm, locale: locale) + private static func mobFormat(isShortForm: Bool) -> NumberFormatter { + isShortForm ? mobFormatShort : mobFormatLong } // Used for formatting decimal numbers in the diff --git a/SignalMessaging/Payments/PaymentsImpl.swift b/SignalMessaging/Payments/PaymentsImpl.swift index 508a1a866e..d717f9d496 100644 --- a/SignalMessaging/Payments/PaymentsImpl.swift +++ b/SignalMessaging/Payments/PaymentsImpl.swift @@ -138,7 +138,6 @@ public class PaymentsImpl: NSObject, PaymentsSwift { owsFailDebug("Missing countryCode: \(localNumber).") return false } -// return true let validCountryCodes: [Int] = [ // France 33,