views:

35

answers:

1

Hi

I need to convert integers into two decimal float numbers. So if i have an integer 3 i want it to be float 03. But if i have an two digit integer 33, i want it to be float 33.

+1  A: 

The float value will always just be the actual number value. If you want to display that value and have to appear with a leading 0, you will have to use string formatting and the format options to produce "03" from a value of 3.

unholysampler
Just to give him an example: `NSString *formatted = [NSString stringWithFormat:@"%02i", integer];`
Pascal