[ 
http://issues.apache.org/jira/browse/MYFACES-641?page=comments#action_12332237 
] 

Lee Smith commented on MYFACES-641:
-----------------------------------

I've also experienced this problem and believe I have traced it to the locale. 
It seems that the converter is only receiving a locale with language 
information and no territory.

In the Java libraries if only a language is specified the NumberFormat class 
doesn't replace the currency symbol (presumably becuase it doesn't know what to 
replace it with).

This can be verified by manually creating a new NumberFormat instance using the 
following code:

NumberFormat formatter = NumberFormat.getCurrencyInstance(Locale.EN);
System.out.println(formatter.format(123.456));

Which outputs:

   ¤123.46

If however you use a locale which includes a territory:

NumberFormat formatter = NumberFormat.getCurrencyInstance(Locale.UK);
System.out.println(formatter.format(123.456));

You get:

   £123.46

Not sure why the coverter isn't getting a full locale - it might be becuase the 
browser isn't sending it through, or the browser is only sending a language and 
no territory. Although if you say this is working in the RI, this sounds 
unlikely.

Cheers, Lee

> <f:convertNumber type="currency"/> not working properly.
> --------------------------------------------------------
>
>          Key: MYFACES-641
>          URL: http://issues.apache.org/jira/browse/MYFACES-641
>      Project: MyFaces
>         Type: Bug
>   Components: General
>     Versions: 1.1.0
>  Environment: Win XP Professional SP2
>     Reporter: Tim Mashinter
>     Priority: Minor

>
> <h:outputText value=#{object.dollarAmount}">
>      <f:convertNumber type="currency"/>
> </h:outputText>
> When using the sun implementation of JSF it outputs the following: $1,200.55
> When using the MyFaces implemenation if output the following: ¤1,200.55
> The pattern being used is correct. But the currency symbol isn't 
> automatically determined based on my locale the same way the SUN 
> implementation is done. 
> Having this automatically determined based on the systems locale makes this 
> better for applications aiming to support multiple languages (I18N).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to