Possible Duplicate:
NSNumberFormatter for rounding up float values
Currently, I calculate the scaling factor by using :
CGFloat scale = CGContextGetCTM(context).a;
NSLog(@"SCALE : %f", scale);
I receive a floating point value as : 0.124979, 0.249958, 0.499917. How can I use roundf to get it convert to 0.125, 0.250, 0.500 respectively.
Try this........
NSLog(@"SCALE : %.3f", scale);
NSString *value = [NSString stringWithFormat:@"%.3f", theFloat];
Stolen from Previous SO answer