I am trying to render a float value using NSNumberFormatter's SpellOutStyle, but the results are unsatisfactory, and I haven't been able to find a solution so far. The issue is, when given a float value such as 3.2, NSNumberFormatterSpellOutStyle renders it as something like this: "three point two zero zero zero zero zero zero four seven six eight three seven two".
When using the SpellOutStyle, setting the roundingMode or maximumFractionDigits properties don't seem to have any effect.
Here is a sample of how I am running the code:
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setNumberStyle:NSNumberFormatterSpellOutStyle];
NSNumber *numberValue = [NSNumber numberWithFloat:3.2];
NSLog(@"Number: %@", [numberFormatter stringFromNumber:numberValue]);
// Outputs three point two zero zero zero zero zero zero ...
[numberFormatter release];
Any ideas?