Re: Help with Stupid question



printf will round. Try it:

printf ("should be 25.8 : %.1f$/", 25.79);

prints:
should be 25.8 : 25.8

Just one caveat here: as I understand it, sprintf() will not round the
decimal, it will just truncate it, so if you need to round up or down
the number, I would suggest looking through the math modules.


Peter Cornelius
Sr. Software Engineer
LiveOps (http://liveops.com)
.



Relevant Pages