On Oct 17, 2007, at 21:48 , Ivan Sergio Borgonovo wrote:
On Wed, 17 Oct 2007 19:52:33 +0200 Wim Leers <work@wimleers.com> wrote:
My Money CCK field module [1] already supports portions of the desired functionality: 1) You can choose whatever currency you want to store your amount in. 2) You can choose the digit group separator and the decimal separator. 3) Two formatters are offered: currency code before/after the amount.
I gave a look at the code. I think something a bit more generalised could gain more acceptance. I'm thinking about position of the sign and relaying on a more general number format. People may not want to follow ISO but just output their stuff accordingly to traditions.
Sign positioning was not yet needed, not even requested. But it could obviously be added with ease. IIRC, there's no such thing as CCK formatter settings though. This means that you'd have to provide formatters such as: "format: <ISO code> <sign> <amount>", "format: <sign> <ISO code> <amount>", "format: <symbol> <sign> <amount>", etc. As you can see, the number of formatters becomes overwhelming. Ideally, you would be able to define your own formatters (with drag and drop). But that's something CCK currently doesn't support (again, AFAIK). What do you mean by "relying on a more general number format"? The fact that all numbers are stored as an integer (this prevents rounding errors that could occur when it was stored as a float) and that only 2 decimals are assumed? That can be implemented easily. Wim Leers ~ http://wimleers.com/work