diff options
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 2664baed..9fddacbb 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -818,7 +818,9 @@ function parseNumerical(value, type) { return '0'; } if (isNumber(value)) { - return parseFloat(value).toString(); // will change e.g. 5.000000e+01 to 50 + var ret = parseFloat(value); // will change e.g. 5.000000e+01 to 50 + if (type in Runtime.FLOAT_TYPES && value[0] == '-' && ret === 0) return '-0'; // fix negative 0, toString makes it 0 + return ret.toString(); } else { return value; } |