« Return to Thread: [jira] [Created] (TRINIDAD-2139) Client NumberConverter with type=percent ignores maxfractiondigits when formatting

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

by My Faces - Dev mailing list :: Rate this Message:

| View in Thread

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


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

       

 « Return to Thread: [jira] [Created] (TRINIDAD-2139) Client NumberConverter with type=percent ignores maxfractiondigits when formatting