JS: Don't require leading zeros on float styles.

This commit is contained in:
Arthur Britto
2013-01-28 11:49:26 -08:00
committed by Stefan Thomas
parent ba41b1b27d
commit ddd9407170

View File

@@ -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