1
0
mirror of https://github.com/MikeMcl/decimal.js.git synced 2025-06-09 19:04:18 +00:00

Fix Space and Null

This commit is contained in:
thefantas 2021-01-27 22:21:05 +02:00 committed by GitHub
parent 11699c1d1c
commit 7d8952f623
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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