cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Enke, Michael" <michael.e...@wincor-nixdorf.com>
Subject Re: [PATCH] I18nTransformer decimal and grouping locale
Date Thu, 22 May 2003 18:55:46 GMT
Konstantin Piroumian wrote:
> 
> From: "Enke, Michael" <michael.enke@wincor-nixdorf.com>
> 
> > At the time of writing I'm on vacation so I did not follow the thread.
> > But from what I read in this mail:
> > The format of currencies in difference to number is not only the currency
> sign,
> > it is also if it stands before or after the number and maybe something I
> do not know.
> > So I'm writing software for retail business and thought a long time about
> this.
> > That's why I choose this approach.
> 
> I see.
> But it also not only overriding the grouping and decimal separators. E.g.
> for arabic countries you'll need to change also the digit characters.
> 
> > Again: Someone from US wants to see a currency for european country: 12345
> Euro and 67 cent.
> > In de_DE this would be 12.345,67 Euor
> > in en_US this would be $12,345.67
> > The guy from US should see: 12,345.67 Euro
> > The guy rom Germany should see: 12.345,67 Euro
> > This is the case if a e.g. McDonalds manager from US want to see the net
> sale amount of
> > the German headquarter.
> > I use of course the information from JRE to get the grouping and decimal
> separator.
> > I reuse them, but the locale must be known.
> 
> Yes, I understand quite well this issue. Ok. Let's try to do it other way:
> you specify the currency of the value, get a currency format instance and
> override NumberFormatSymbols using the target locale. E.g.:
> <i18n:number type="currency" locale="en_US" currency-locale="de_EURO" />
> 
> What do you think?

I'm not sure if I understand you correct.
Do you mean: get currency format instance for (in this example) de_DE
and override FormatSymbols with FormatSymbols from NumberFormat en_US?
I do override with DecimalFormatSymbols. Isn't this what I did?
Ok, we can change the names:
What I called "dec-and-grp-locale" can be "locale"
and what I had "locale" can be "currency-locale". This is more straight forward.
Than it is what you mean? Ok.

If I did not got you, do you mean the other way?
Get currency format instance for en_US and override with somethink from de_DE?
Keep in mind that not all currencies have 2 digits behind the decimal separator.
There are countries without digits behind decimal.

Regards,
Michael

> Regards,
>   Konstantin
> 
> >
> > Regards,
> > Michael
> >
> >
> > Bruno Dumon schrieb:
> > >
> > > On Wed, 2003-05-21 at 08:15, Konstantin Piroumian wrote:
> > > > >
> > > > > However, the knowledge of what the decimal-separtor and
> group-seperator
> > > > > are for a certain locale is already present in the JRE for a large
> > > > > number of locales. Why not reuse that as the dec-and-grp-locale
> > > > > attribute is doing? Otherwise you'd have to define germans-for-*
> formats
> > > > > for all countries in which you are selling.
> > > >
> > > > So maybe for such cases it'd be easier to use the target country
> locale
> > > > (i.e. en_US) and just allow to override the currency sign? E.g.:
> 1,000.99 DM
> > >
> > > Would probably also work, I'd like to here from Michael if he finds this
> > > ok. But aren't there any other properties like the number of digits
> > > after the decimal point that should then also change? In the end it
> > > seems like a rather arbitrary choice in which direction the properties
> > > are copied over.
> > >
> > > (if you really don't like any of this, or want more time to think about
> > > this, I can revert the patch for now and reopen the bugzilla entry)
> > >
> > > --
> > > Bruno Dumon                             http://outerthought.org/
> > > Outerthought - Open Source, Java & XML Competence Support Center
> > > bruno@outerthought.org                          bruno@apache.org
> >
> >

Mime
View raw message