diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-30 13:34:00 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-10-02 17:31:37 -0700 |
commit | d476a5881aa03136ab3ccd2c9002eb289f5b8960 (patch) | |
tree | ed603c1702a8e98bd77f1a0f2f5f3d307da65de3 /src | |
parent | 154a96f439191c8422dc339d1ef6eb57d97d0409 (diff) |
do not remove '.' from floats in parseNumerical
Diffstat (limited to 'src')
-rw-r--r-- | src/parseTools.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index adde8d63..801e2e7a 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -930,7 +930,10 @@ function parseNumerical(value, type) { } if (isNumber(value)) { 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 + if (type in Runtime.FLOAT_TYPES) { + if (value[0] === '-' && ret === 0) return '-.0'; // fix negative 0, toString makes it 0 + if (!RUNNING_JS_OPTS) ret = asmEnsureFloat(ret, type); + } return ret.toString(); } else { return value; |