mirror of
https://github.com/MikeMcl/decimal.js.git
synced 2025-06-11 20:04:28 +00:00
Fix Space and Null
This commit is contained in:
parent
11699c1d1c
commit
7d8952f623
@ -4252,7 +4252,8 @@
|
|||||||
function Decimal(v) {
|
function Decimal(v) {
|
||||||
var e, i, t,
|
var e, i, t,
|
||||||
x = this;
|
x = this;
|
||||||
|
if (typeof v !== "undefined" && v && v.constructor === String) v = v.trim();
|
||||||
|
if (typeof v === "undefined" || !v) v = "0";
|
||||||
// Decimal called without new.
|
// Decimal called without new.
|
||||||
if (!(x instanceof Decimal)) return new Decimal(v);
|
if (!(x instanceof Decimal)) return new Decimal(v);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user