I'm trying to figure out the right way to format a Decimal number as a currency value in Swift.
For example, if the Decimal contains the value 25.1 I'd want this to print as "$25.10". If it had the value 25, I'd want "$25.00". If it happened to contain a value like 25.4575, I'd want to round it off and display "$25.46".
There are a confusing amount of functions surrounding Decimals and string formatting. I know I can't just use String(format: "%.2f", value) like I can do with floats and doubles.
There appears to be a new FormatStyle property of Decimal, but I can't use that yet because it requires iOS 15.
Thanks, Frank