I’ve got some NSString equal @"1234567.89". I have to make floatValue from this string. When I called [myString floatValue] then this float is equal 1234567.875000. How to keep before this? I want have floatValue equal 1234567.89000.
Thank you for help.
The problem is that a float can’t represent a number that large with the precision you’re looking for. Try using a double instead, and retrieve it using
[myString doubleValue]. The small example program below demonstrates this: