[Zope] Using fpformat in python scrips; Was: Currency formatting from within Python Script

complaw@hal-pc.org complaw@hal-pc.org
Tue, 8 Jan 2002 22:31:32 GMT


Thanks Steve, that was indeed very simple.

However, I have stumbled across an seemingly strange (at first blush) issue. 
There is a module called fpformat that will allow for floating point formatting. 

fpfloat.py is /lib/python2.1/fpfloat.py

It is available to Products, but not to python scripts.  My question is, if I do
what Andreas says and have a product called FP, with a python file called
fpfloat.py and an appropriate __init__.py script, will that interfere with
anything?

Instead, what if I modified PythonScript.py and simply added "import fpfloat"
(and restarted Zope)?

Ron

>  
> > 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.
> 
> print "$%9.2f"
> return printed
> 
> 
> _______________________________________________
> 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 )
>