You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Yee-Wah Lee (JIRA)" <de...@myfaces.apache.org> on 2011/09/14 19:53:08 UTC

[jira] [Issue Comment Edited] (TRINIDAD-2139) Client NumberConverter with type=percent ignores maxfractiondigits when formatting

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

Yee-Wah Lee edited comment on TRINIDAD-2139 at 9/14/11 5:51 PM:
----------------------------------------------------------------

Trinidad-2139 patch for trunk and 1.2.12.6.0 branch

      was (Author: yeelee):
    Trunk patch for Trinidad-2139
  
> Client NumberConverter with type=percent ignores maxfractiondigits when formatting
> ----------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-2139
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2139
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0
>            Reporter: Yee-Wah Lee
>            Priority: Minor
>         Attachments: trunk_2139_numberPercentMaxFrac.diff
>
>
> NumberFormat.js contains the following code:
> TrNumberFormat.prototype.percentageToString = function(number)
> {
>   number = number * 100;
>   number = this.getRounded(number);
> ..   number = this.numberToString(number);
> }
> consideration the number of fractionDigits but numberToString later will.
> TrNumberFormat.prototype.getRounded = function(val)
> {
>   val = this.moveDecimalRight(val);
>   val = Math.round(val);
>   val = this.moveDecimalLeft(val);
>   return val;
> }
> Math.round function will round to the nearest integer. With the earlier multiplication to 100, precision is preserved to at most two digits, regardless of the maxFractionDigits attribute.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira