Display number value to the max number of decimal places

iPhone SDK Tips & Tricks

float x = 1.23;
NSLog(@"%g", x); //1.23
NSLog(@"%f", x); //1.23000000