Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.0-core
-
None
Description
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.