views:

15

answers:

1

Hi all! How to disable symbols after dot in double values? 13 + 3.456 = 16.456 GOOD

13 + 1 = 14.00 BAD! I need 14 how can I do It?

I am using NSMutableString.

+1  A: 
if ([yourString doubleValue] % 1 == 0) {
    [yourString setString:[NSMutableString stringWithFormat:@"%d", [yourString intValue]]];
}
muffix
You may want to change the out rather than covert the value. [NSString stringWithFormat: @"%.0f"];
jessecurry