[ 
https://issues.apache.org/jira/browse/TRINIDAD-2354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13562084#comment-13562084
 ] 

Yee-Wah Lee commented on TRINIDAD-2354:
---------------------------------------

On the server, creating a NumberFormat with type= percent has maxFractionDigits 
= 0

However, on the client, the default maxFractionDigits=3. So the defaults need 
to be changed in TrNumberFormat() constructor.

Also, the following code which creates a NumberFormat instance to parse the 
percent/currency string should copy the max/min Integer/FractionDigits values.
TrNumberConverter_getAsObject()
{
      // The user could have just left off the percent/currency symbol, so try  
parsing 'numberString' as a Number instead; if it still fails, then
      // throw a converter exception.
      try
      {
        numberString =
TrNumberFormat.getNumberInstance().parse(numberString)+"";
      }

}
                
> convertNumber type=percent server and client results differ. 
> -------------------------------------------------------------
>
>                 Key: TRINIDAD-2354
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2354
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>            Reporter: Yee-Wah Lee
>            Priority: Minor
>
> 1. Create an inputText with child numberConverter, type=percent. Or, see 
> example here:
> http://example.irian.at/trinidad-demo/faces/convertValidate/convertValidate.jspx
> 2. Enter 2.75 into the input field and Submit
> 2a.  The client converter initially changes it to "2.75%" 
> 2b. After the server returns, it displays as "3%".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to