0

If I do the following in Swift 3:

print(Decimal(0.23))

I get "0.2300000000000000512".

Is there a better way to initialize it other than:

print(Decimal(string:"0.23"))
aircan
  • 291
  • 1
  • 3
  • 6

0 Answers0