Dear All,

I need one help.

In python, I need to set the floating point precision as 2.

I am getting the following output in python while adding two float nos.

>>>a=79.73
>>>b=0.5
>>> a+b
80.230000000000004

I need exactly 2 precision point in this float value. i.e. 80.23

Even though I tried in round method, its not satisfied me. Because

>>> a = round(3.7138464897123424324355124355,2)
>>> a
3.71
>>> a = round(3.7238464897123424324355124355,2)
>>> a
3.7200000000000002

Can you understand the difference. Depends upon the value, it will round.

I no need ceil and floor options. Because it may change the original values.

I need just 2 precision point in the float value.

I am getting two numbers dynamically. So I can not say exactly, what kind of
floating numbers I am going to use.

What I have to do ?

Any suggestions ?

Thanks in advance.




-- 
Regards,
Arulalan.T

Kanchi Linux User Group Rocks !
http://kanchilug.wordpress.com

My Experiments In Linux are here
http://tuxcoder.wordpress.com
_______________________________________________
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers

Reply via email to