better formatFloat replace method

This commit is contained in:
Mottie 2013-10-26 05:41:39 -05:00
parent c186b3024b
commit dc27ec2986

View File

@ -1317,7 +1317,7 @@
}
if(/^\s*\([.\d]+\)/.test(s)) {
// make (#) into a negative number -> (10) = -10
s = s.replace(/^\s*\(/,'-').replace(/\)/,'');
s = s.replace(/^\s*\(([.\d]+)\)/, '-$1');
}
i = parseFloat(s);
// return the text instead of zero