For example, I have float values like:
0.2 1.5 2.0 3.0 10.0 52.5 60.0
Under any circumstances, I really want one fractional digit. Even if the number is exactly 1, i want it to be displayed as 1.0
I tried to set up an NSNumberFormatter like this, but it doesn't work:
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setAlwaysShowsDecimalSeparator:NO];
[formatter setAllowsFloats:YES];
[formatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
[formatter setMinimumFractionDigits:1];
[formatter setUsesSignificantDigits:YES];
[formatter setMinimumSignificantDigits:2];
[formatter setNumberStyle:kCFNumberFormatterDecimalStyle];
It shows 0.2, 5.0, 5.5, 9.0,
but when it reaches 10, it would show 10, 10.3, 11, 11.9, 15, ... and so on. Is this something NSNumberFormatter can't do?