Decimal128
It would be very convenient if Decimal128 had options for string formatting - it could then for example, more easily be used for currency. Similar to how a Double can be formatted
As is, Swift Doubles have this feature:
let myDouble = 1999.95
let currencyFormatted = myDouble.formatted(.currency(code: "USD"))
print(currencyFormatted)
and the output is
$1,999.95
My suggest is to add a formatted feature to Decimal128
let d = Decimal128(1999.95)
let s = d.formatted(.currency(code: "USD"))
1
vote
Jason
shared this idea