From d31d83c125eeb17b9e712795e32c9ae0f153a6f8 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Mon, 28 Jan 2013 11:49:26 -0800 Subject: [PATCH] JS: Don't require leading zeros on float styles. --- src/js/amount.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/amount.js b/src/js/amount.js index 222b912284..b24ff0397b 100644 --- a/src/js/amount.js +++ b/src/js/amount.js @@ -1009,7 +1009,7 @@ Amount.prototype.parse_native = function (j) { var m; if ('string' === typeof j) - m = j.match(/^(-?)(\d+)(\.\d{0,6})?$/); + m = j.match(/^(-?)(\d*)(\.\d{0,6})?$/); if (m) { if (undefined === m[3]) { @@ -1056,8 +1056,8 @@ 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 d = !i && j.match(/^(-?)(\d*)\.(\d*)$/); + var e = !e && j.match(/^(-?)(\d*)e(-?\d+)$/); if (e) { // e notation