PDA

View Full Version : format numbers in a string




coolman
Sep 24, 2008, 07:03 PM
Hi,

I would like to format numbers into a string so I tried this

NSString *myString = [NSString localizedStringWithFormat:@"%5.2f", 1234.56];

but myString gives me 1234.56

For Spain this must give me 1.234,56
and for us locale 1,234.56

I want the dots or commas each three digits.

How can i do this in a quick (execution speed) way?