diff --git a/decimal.js b/decimal.js index 23cc2d3..7f2db55 100644 --- a/decimal.js +++ b/decimal.js @@ -4252,7 +4252,8 @@ function Decimal(v) { var e, i, t, x = this; - + if (typeof v !== "undefined" && v && v.constructor === String) v = v.trim(); + if (typeof v === "undefined" || !v) v = "0"; // Decimal called without new. if (!(x instanceof Decimal)) return new Decimal(v);