[Zope3-Users] Internationalization, Widgets, and Currency

Gary Poster gary at zope.com
Tue May 9 09:10:45 EDT 2006


On May 9, 2006, at 1:37 AM, Tom Dossis wrote:

> David Johnson wrote:
>> I am trying to implement a currency input using a Float widget.

This wasn't your question, but, eek!  Currency should use a python  
decimal.Decimal, never a float.  I don't think we have  schema field  
and widget yet, but it would be trivial to add (the widget would  
effectively be identical, I believe).  Using floats for money is a  
bad idea

(a classic example:
 >>> 3.3
3.2999999999999998
 >>> import decimal
 >>> decimal.Decimal("3.3")
Decimal("3.3")
)

Gary


More information about the Zope3-users mailing list