aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-20 13:44:50 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-03-20 13:44:50 -0700
commit669c786e3554b280e31dcb7bd92931482547dae0 (patch)
tree110d48a9e6bf29ceed41ac6282dc37d2f0f3f433 /src/parseTools.js
parentb22f6fbbbebb5df55ceb8fdc9f7c4d111c902c5e (diff)
parent421e70ecf266d6619415b53c1bc03d4a127a585d (diff)
Merge branch 'incoming'
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js4
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;
}