I have a double that I need only the value of everything before the decimal point.
Currently I am using
NSString *level = [NSString stringWithFormat:@"%.1f",doubleLevel];
but when given a value of 9.96, this returns “10”. So it is rounding. I need it to return only the “9”. (note – when the value is 9.95, it correctly returns the “9” value.)
Any suggestions?
Thank You.
Simply assign the float/double value to a int value.