JS: Fix amount parsing to accept negative exponents.

This commit is contained in:
Arthur Britto
2012-12-17 17:33:02 -08:00
committed by Stefan Thomas
parent 2baccc4800
commit 81882bd1fa

View File

@@ -1025,7 +1025,7 @@ Amount.prototype.parse_value = function (j) {
else if ('string' === typeof j) {
var i = j.match(/^(-?)(\d+)$/);
var d = !i && j.match(/^(-?)(\d+)\.(\d*)$/);
var e = !e && j.match(/^(-?)(\d+)e(\d+)$/);
var e = !e && j.match(/^(-?)(\d+)e(-?\d+)$/);
if (e) {
// e notation