diff --git a/test/util-util.js b/test/util-util.js index aba0be870..fb4650a9d 100644 --- a/test/util-util.js +++ b/test/util-util.js @@ -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); }); }); diff --git a/util/util.js b/util/util.js index 9c54ea260..145568dd0 100644 --- a/util/util.js +++ b/util/util.js @@ -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;