[Zope] Newbie: Simple Formatting floats in DTML
Tue, 25 Mar 2003 14:41:05 +0000
Ok, thanks very much for your reply.
From: Dieter Maurer <firstname.lastname@example.org>
To: "Ashley Lloyd" <email@example.com>
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
> lists I still have not found an answer.
> I need to format a great deal of floating point numbers for accountants
> read, so need them using thousands_commas and if they are negative,
> 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
> parameter, similar to thousands_commas, (like negative_brackets, say)
> 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".
It's fast, it's easy and it's free. Get MSN Messenger today!