[Tutor] Rounding number

Per Jr. Greisen pgreisen at gmail.com
Sun Mar 18 18:45:46 CET 2007


Hi,

I use the method from math in order to round off the number:

import math

a = 1.39999

b = round(a,3)

which equals gives
b=1.4

is it possible to have the rounding such that
b = 1.400

so it keeps in my case the correct digits?

Any help appreciate. Thanks in advance



-- 
Best regards
Per Jr. Greisen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070318/4385b159/attachment.htm 


More information about the Tutor mailing list