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.
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.
if ([yourString doubleValue] % 1 == 0) {
[yourString setString:[NSMutableString stringWithFormat:@"%d", [yourString intValue]]];
}