fix truncation error in parseValue
This commit is contained in:
parent
7d0a3da3e4
commit
71cd92d225
|
@ -16,7 +16,10 @@ describe('util/util', function(){
|
|||
[ "1.0", "100000000" ],
|
||||
[ "0.1", "10000000" ],
|
||||
[ ".1", "10000000" ],
|
||||
[ "0.0005", "50000" ]
|
||||
[ "0.0005", "50000" ],
|
||||
[ ".000000001", "0" ],
|
||||
[ ".000000009", "0" ],
|
||||
[ ".00000000000000001", "0" ]
|
||||
];
|
||||
dataValues.forEach(function(datum) { test_value(datum); });
|
||||
});
|
||||
|
|
|
@ -113,6 +113,7 @@ var reWholeVal = /^\s*(\d+)/;
|
|||
|
||||
function padFrac(frac)
|
||||
{
|
||||
frac=frac.substr(0,8); //truncate to 8 decimal places
|
||||
while (frac.length < 8)
|
||||
frac = frac + '0';
|
||||
return frac;
|
||||
|
|
Loading…
Reference in New Issue