I am trying to trim zeros after a decimal point as below but it\'s not giving desired result.
trig = [currentVal doubleValue];
trig = trig/100;
NSNumberForma
This will not display any decimal value after the decimal point:
display.text = [NSString stringWithFormat:@"%1.0f", trig];
This will just trim the zeros after the decimal point:
isplay.text = [NSString stringWithFormat:@"%3.2f", trig];
display.text = [display.text stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat@"0"]]];
Note, this may leave you with the trailing decimal point. "124." may happen. I guess that some smarter solution will be posted soon.