laziness, impatience, and hubris | |
PerlMonks |
Re: Using (s)printf()by Anonymous Monk |
on Aug 01, 2012 at 16:59 UTC ( [id://984833]=note: print w/replies, xml ) | Need Help?? |
Your statement and example under "Rounding Numbers with sprintf()" is incorrect and misleading. Using "%d" does NOT round a float as necessary, it merely truncates everything after the decimal. Thus, printf("%d", 3.99); # will print 3, not 4.
In Section
Tutorials
|
|