[Tutor] sales tax

Alan Gauld alan.gauld at btinternet.com
Wed Sep 19 09:37:48 CEST 2007


"Michael Langford" <mlangford.cs03 at gtalumni.org> wrote

> PS: The function you're looking for is called round. Its first param 
> is the
> number to round, the seconds is how many digits past the radix point 
> to
> keep.

Caveat:
Note that round will perform math style rounding - sometimes
rounding up, sometimes rounding down. If you have legal retrictions
that force rounding down, say, then round() will not work as required.

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list