I'm trying to convert a double to a string in Swift and experiencing a significant loss in precision. Here's my code:
var myDouble : Double = 23.00
myDouble = myDouble / 100
var myString : String = String(format: "%.20f", myDouble)
println(myString)
expected result: 0.23000000000000000000
actual result: 0.23000000000000000999
Any idea what's going on?
Thanks! Mike