[Tutor] rounding

Kim Branson kim.branson at gmail.com
Mon Jan 31 00:34:38 CET 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ahhh, the second argument to round. That will do what i want.  It was 
fairly late and i didn't see that argument in the docs. although now i 
look at it in the light of day its there. neat. I've replaced by divide 
by 10 stuff with that.  now i have different bugs to chase :)

cheers
Kim
On 31/01/2005, at 9:37 AM, Alan Gauld wrote:

>
>> The round function will do what you want though not quite what you
> say you want :-)
>>
>>>>> round(15., -1)
>> 20.0
>
> Interesting, I didn't remember the second parameter to round...
> let alone the fact it could be negative!!
>
> Batteries included once again!
>
> Alan G.
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
Kim Branson
Diffraction and Theory
CSIRO Health Sciences and Nutrition
343 Royal Parade, Parkville
Melbourne
Ph +613 9662 7136
kim.branson at csiro.au
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFB/W8Oer2hmGbHcokRAlRwAJkB1NNVnxUN3i2/4bNyKEeiVorDzQCfXGIo
JnnkKWdwrIH9XOkB6gFUFAY=
=iCJq
-----END PGP SIGNATURE-----



More information about the Tutor mailing list