[
https://issues.apache.org/jira/browse/TRINIDAD-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223545#comment-13223545
]
Yee-Wah Lee edited comment on TRINIDAD-2139 at 4/26/12 6:34 PM:
----------------------------------------------------------------
1.2.12.7.0 fix for Trinidad-2139, allow NumberFormat to honor maxFractionDigits
Patch also works for 1.2.12.6.2 branch
was (Author: yeelee):
1.2.12.7.0 fix for Trinidad-2139, allow NumberFormat to honor
maxFractionDigits
> 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-core
> Reporter: Yee-Wah Lee
> Assignee: Gabrielle Crawford
> Priority: Minor
> Fix For: 2.0.1-core
>
> Attachments: branch121270_2139_maxFracDigits.diff,
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira