What is the correct way of represent double value as NSString ?
In my code, it is calculating or rather doing some kind of rounding..I am not sure. Below is my code;
X = [NSString stringWithFormat:@"%d", [abc doubleValue] - [xyz doubleValue]];
I am getting
abc is 69206000000, xyz is 31687000000, X is 58720256
Please help me.
Use the
%fformat modifier to display a double value – the%din your code refers to an integer value. (See String Format Specifiers for more info.)