I'm using the NSNumberFormatter to format currency but the formatter is not working when i use floats. However it works when I use double. i need it to work with floats as I don't need to work in double.
float t1 = 999999.99;
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[formatter setAllowsFloats:YES];
[formatter setMaximumFractionDigits:2];
[formatter setAlwaysShowsDecimalSeparator:YES];
[formatter setGeneratesDecimalNumbers:YES];
NSString *formattedOutput = [formatter stringFromNumber:[NSNumber numberWithFloat:t1]];
NSLog(@"Output as currency: %@", formattedOutput);
this outputs - Output as currency: $1,000,000.00 and not as $9,99,999.99
Thanks in advance for your help on this.