Currency formatting

This commit is contained in:
Ali
2021-04-21 00:04:27 +04:00
parent 121b1b1bb4
commit d0d03173f0
2 changed files with 361 additions and 24 deletions

View File

@@ -209,3 +209,20 @@ public func formatCurrencyAmountCustom(_ amount: Int64, currency: String) -> (St
return ("", "", false)
}
}
public struct CurrencyFormat {
public var symbol: String
public var symbolOnLeft: Bool
public var decimalSeparator: String
public var decimalDigits: Int
public init?(currency: String) {
guard let entry = currencyFormatterEntries[currency] else {
return nil
}
self.symbol = entry.symbol
self.symbolOnLeft = entry.symbolOnLeft
self.decimalSeparator = entry.decimalSeparator
self.decimalDigits = entry.decimalDigits
}
}