376Variable length of accuracy of float in NSString

float f = 1.23456;

NSLog(@"%.2f", f);
NSLog(@"%.0f", f);
NSLog(@"%.0f", f);
1.23 1 1.23456

305Converting float to string %4.2f

printf ("floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416); floats: 3.14 +3e+000 3.141600E+000


CGPoint CGPointMake ( CGFloat x, CGFloat y ); x, y has to be floats, passing only integers might not work. especially good to know, when and if ints get converted into floats. = CGPointMake(100.0f + someIntVar, 50.0f + anotherIntVar); ≠ CGPointMake(100 + someIntVar, 50 + anotherIntVar); this .0f seems to have a meaning after all.