On Nov 13, 2009, at 4:36 PM, Massimo Di Pierro wrote:
> In theory double has 53 bits. Yet I tried and it does not seem to work
> properly. It rounds to the cents. You may want to try the attached
> files. Perhaps I am doing something wrong.
I'm not advocating floating point; I think it's a pain, and if integer is
working, that's better. But....
>>> from decimal import *
>>> b = Decimal("1234567891.987654321")
>>> b
Decimal('1234567891.987654321')
>>> float(b)
1234567891.9876542
>>> str(float(b))
'1234567891.99'
>>> repr(float(b))
'1234567891.9876542'
I haven't checked, but it looks like an artifact of float.str.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---