[development] code proposal: localization of currency, ...
work at wimleers.com
Wed Oct 17 21:38:04 UTC 2007
On Oct 17, 2007, at 21:48 , Ivan Sergio Borgonovo wrote:
> On Wed, 17 Oct 2007 19:52:33 +0200
> Wim Leers <work at wimleers.com> wrote:
>> My Money CCK field module  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,
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
More information about the development