cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <>
Subject Re: RFC: Using icu4j for number formatting
Date Thu, 31 Jul 2008 10:31:46 GMT
Hi Joerg

Yes, there are separate icu4jDateConvertor and FormattingDateConvertor  
(which uses the original java.text.DateFormat).

The problem I see, replicating the same separation with Numbers, is  
having to make almost duplicates of the many  
Formatting[Number]Convertors, feels like a mess ..... unless someone  
can think of a better way of doing it .....

BTW. Changing to icu4j immediately fixed the majority of formatting  
problems between CForms and Dojo, the main category still not working  
are languages (eg. Arabic, Hindi etc.) that use different characters  
for number digits. Also there are unexpected problems converting the  
request params back to numbers again (hope to crack that today ... ).

The problem icu4j is solving IMHO is more than Dojo compatibility.
The java.text.NumberFormat classes seem to have really stale data,  
switching JVM (or OS) would probably change the formats it outputs.

Number, currency and currency symbols are cultural artefacts, they  
change over time (countries change currency etc.), IBM seem to be more  
proactive in keeping their libraries up to date.

Any suggestions about a clean way to have both Java and ICU  
NumberFormat ?


regards Jeremy

On 30 Jul 2008, at 16:35, Joerg Heinicke wrote:

> Jeremy Quinn <jeremy <at>> writes:
>> Currently, o.a.c.forms.datatype.convertor.FormattingDecimalConvertor
>> (the baseclass for all Number Formatting convertors), uses
>> java.text.DecimalFormat internally, without exposing the class to the
>> outside (except for one protected Method).
>> If I were to re-implement FormattingDecimalConvertor using icu4j,
>> should I leave the old one alone and create a new
>> icu4jFormattingDecimalConvertor, or work with the original class?
> Please see [1].
>> If this solves the problem, this would be the only decimal convertor
>> that would work properly with Dojo, so it would seem pointless to
>> leave the old one around, leading to confusion .....
> But Dojo is not the only option. And considering the differences  
> between icu4j
> and java.text people might want to have the option to switch. I  
> don't know if
> Sylvain ever did what he wanted to do (last mail in mentioned thread).
> Joerg
> [1]

View raw message