Hi,

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.
After a little bit of research I found out that I could use # as a flag 
(%.#2f). But, even in this case, I get 25. (with the dot). So, what's the right 
way for displaying only 25 (mantaining the 2 decimal places for numbers that 
use them)?

PS: I followed the idea behind here 
(http://stackoverflow.com/questions/560517/how-to-set-the-float-value-to-two-decimal-number-in-objective-c)
 but it didn't work.

Thanks
Adriano_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to