Re: Formatting float numbers

2010-08-25 Thread Greg Parker
On Aug 23, 2010, at 1:35 AM, Adriano Brandão wrote: > Thanks man, I tested here and it's working now. > > But, just for curiosity, if I was using only c++ wouldn't I be able to do > that? libicu's C interface provides the same number formatting as NSNumberFormatter. They're both implementing t

Re: Formatting float numbers

2010-08-25 Thread Andreas Grosam
On Aug 23, 2010, at 1:35 AM, Adriano Brandão wrote: > Thanks man, I tested here and it's working now. > > But, just for curiosity, if I was using only c++ wouldn't I be able to do > that? Using the C and C++ standard libraries only, you can't do that with the provided formatters. With the c-

Re: Formatting float numbers

2010-08-23 Thread Ken Thomases
On Aug 22, 2010, at 6:35 PM, Adriano Brandão wrote: > But, just for curiosity, if I was using only c++ wouldn't I be able to do > that? You could presumably accomplish much the same thing using the CFNumberFormatter API. Regards, Ken ___ Cocoa-dev

Re: Formatting float numbers

2010-08-23 Thread Adriano Brandão
Thanks man, I tested here and it's working now. But, just for curiosity, if I was using only c++ wouldn't I be able to do that? On 22/08/2010, at 19:04, Greg Parker wrote: > On Aug 21, 2010, at 9:59 AM, Adriano Brandão wrote: >> I'm having some troubles in formatting float numbers. If I wish t

Re: Formatting float numbers

2010-08-22 Thread Greg Parker
On Aug 21, 2010, at 9:59 AM, Adriano Brandão wrote: > I'm having some troubles in formatting float numbers. If I wish to display > 25.342 using only 2 decimal places I could use %.2f and it would do the job. > But if the number to be formatted is flat (like 25.000) I get 25.00 as a > result. > A