[Solved] NSNumberFormatter thousand separator and trailing zeros
An array balance is an array of NSString NOT NSNumbers. That’s why method stringFromNumber: returns nil. The following example works fine: NSArray *balanceArr =@[@(120.50), @(8500.00)]; NSNumberFormatter *formatter = [NSNumberFormatter new]; [formatter setNumberStyle:NSNumberFormatterDecimalStyle]; [formatter setMinimumFractionDigits:2]; [formatter setGroupingSize:3]; [formatter setGroupingSeparator:@”‘”]; for (NSNumber *balance in balanceArr) { NSLog(@”Straight printing: %@”, balance); NSLog(@”NumberFormatter: %@”, [formatter stringFromNumber:balance]); } Output: 2014-08-22 … Read more