Hello all,
I want to display a number in decimal format only if the number is not an integer. Like if the number is float it must be displayed with one decimal point. But if the number is an integer it must be displayed without a decimal point like its shown in the following link(second part of the code)
http://www.csharp-examples.net/string-format-double/
I am using a string like
NSString *temp =[NSString stringWithFormat:@"0.1f" , 10];
this temp is 10.0 I want it to be 10 but if I am doing as follows
NSString *temp =[NSString stringWithFormat:@"0.1f" , 10.9];
then it must be like 10.9
How to resolve this in iPhone.