Re: German currency format and D2W
Anjo Krank <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
Am 22.03.2006 um 09:16 schrieb Guido Neitzer:
> On 22.03.2006, at 8:46 Uhr, Holzner Roman wrote:
>
>> I'm not sure if it is that, what you are looking for, but perhaps
>> it is useful for you
>>
>> I just setted the formatter for a D2WEditNumber witht he
>> WebAssistant to look what rules is makes for me. The following was
>> the result:
>>
>> ((task = 'edit') and (entity.name = 'LineItem') and (propertyKey
>> = 'price')) => formatter = "#.##0,00"
>>
>
> And this really works for you? If I use this formatter and type
> "7,49" I get "749.00000".
>
> Hmmm. Have to look more into this ... :-/
As you are using Project Wonder and provided that the property
"er.extensions.ERXLocalizer.useLocalizedFormatters" is set to true,
you should just make sure that the current localizer for the session
is German. Then the correct formatter string is "#,##0.00" and it
should simply get picked up and use a localized version.
You can also simply test this by some code like:
ERXLocalizer l = ERXLocalizer.localizerForLanguage("German");
Format f = l.localizedNumberFormatForKey("#,##0.00");
System.out.println(f.format(new BigDecimal(12345.678)));
Cheers, Anjo