From 7d8952f623e22c22ba3592a9846d0c3a7adb61cf Mon Sep 17 00:00:00 2001 From: thefantas Date: Wed, 27 Jan 2021 22:21:05 +0200 Subject: [PATCH] Fix Space and Null --- decimal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);