What steps will reproduce the problem?
1. Use a pattern with decimals (i.e. #,###.00 or #,###.##).
2. Set options.round = false;
3. Format a number with no decimals: 2233
What is the expected output? What do you see instead?
Expected: 2233.00 or 2233
Received: 22.00 or 22
What version of the product are you using? On what operating system?
1.2.2
Please provide any additional information below.
Issue in line 286:
// round or truncate number as needed
if (options.round == true)
number = new Number(number.toFixed(decimalFormat.length));
else {
var numStr = number.toString();
numStr = numStr.substring(0, numStr.lastIndexOf('.') + decimalFormat.length + 1);
number = new Number(numStr);
}
====
Add check for ".": if(numStr.lastIndexOf('.')>0)
// round or truncate number as needed
if (options.round == true)
number = new Number(number.toFixed(decimalFormat.length));
else {
var numStr = number.toString();
if(numStr.lastIndexOf('.')>0)
numStr = numStr.substring(0, numStr.lastIndexOf('.') + decimalFormat.length + 1);
number = new Number(numStr);
}
Original issue reported on code.google.com by discover...@gmail.com on 13 Oct 2011 at 3:29
Original issue reported on code.google.com by
discover...@gmail.com
on 13 Oct 2011 at 3:29