decimal and trunkating

F. Petitjean littlejohn.75 at news.free.fr
Thu Jun 2 15:15:02 CEST 2005


Le Thu, 02 Jun 2005 19:59:08 +1000, Timothy Smith a écrit :
> i want to trunkate 199.999 to 199.99

round(199.999, 2)  # 2 digits after the decimal point

> do i really have to use floats to do this?

19.999  is a float : 
type(19.999) is float  #  ==> True



More information about the Python-list mailing list