danthorpe / Money

Swift value types for working with money & currency
MIT License
933 stars 91 forks source link

Decimal precision #80

Open codepushr opened 7 years ago

codepushr commented 7 years ago

Hi,

I don't seem to figure out how to set a fixed precision, let's say 4.

I tried:

price = EUR(coin.price) // Double
...
cell.price.text = "\((price as EUR).formatted(withStyle: NumberFormatter.Style.decimal))"

Would be glad to get some insight, thanks!