I have a string that I convert to a float that I want to check for values ββin an if statement.
The original float value is iPhone trueHeading, which is returned from the didUpdateHeading method. When I convert the original float to a string using @ "%. 2f", it works fine, but I'm trying to convert the original floating-point number to the same value. IF I just convert the string to [string floatValue], I get the same original floating point number, and I don't want this.
To make it short and simple, how do I take the existing float value and just get the first 2 decimal places?
source share