[Zope] Currency formatting from within Python Script

complaw@hal-pc.org complaw@hal-pc.org
Tue, 8 Jan 2002 20:58:15 GMT


Is there an easier way to simply have a float display (round) to two decimal
places, rather than monkeying around with the access restrictions?  I can add
the '$' to the string.

Ron

> if you need to access the locale module inside PythonScript, you can
> lift the access restrictions (see README in the PythonScripts directory).
> 
> -aj
> 
> ----- Original Message -----
> From: <complaw@hal-pc.org>
> To: <zope@zope.org>
> Sent: Tuesday, January 08, 2002 11:45
> Subject: [Zope] Currency formatting from within Python Script
> 
> 
> > Does anyone have a quick, easy way to format float variables to something
> like a
> > currency (e.g., 1,234.56)?  Use of the locale module (normally used for
> currency
> > issues) is unauthorized within a Python Script.
> >
> > Surely someone must have run into this before.
> >
> > Ron
> >
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> >
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>