[Zope] Newbie: Simple Formatting floats in DTML

Ashley Lloyd ashleylloyd@hotmail.com
Tue, 25 Mar 2003 14:41:05 +0000


Ok, thanks very much for your reply.

Kind regards

Ashley



From: Dieter Maurer <dieter@handshake.de>
To: "Ashley Lloyd" <ashleylloyd@hotmail.com>
CC: zope@zope.org
Subject: Re: [Zope] Newbie: Simple Formatting floats in DTML
Date: Mon, 24 Mar 2003 19:55:35 +0100

Ashley Lloyd wrote at 2003-3-24 11:48 +0000:
  > I know this is a very simple question, but after searching the zope site 
and
  > lists I still have not found an answer.
  >
  > I need to format a great deal of floating point numbers for accountants 
to
  > read, so need them using thousands_commas and if they are negative, 
display
  > them in parentheses without the - sign.
  > eg 1004 = 1,004.00; -25436345.74 = (25,436,345.74)
  >
  > I could write a python script to do this, but I thought there was 
probably a
  > parameter, similar to thousands_commas, (like negative_brackets, say) 
that
  > could to this for me.
  >
  > Can anyone confirm this either way?

You need to write the script for the "negative" handling.

You can use the "thousands_comma" from "Products.PythonScripts.standard".


Dieter


_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://messenger.msn.co.uk