Convert a string or number value to a Decimal instance. Returns Decimal(0) for null, undefined, or empty string values.
The value to convert (string, number, or null/undefined)
A Decimal instance representing the value
const amount = toDecimal("123.456");const price = toDecimal(99.99);const zero = toDecimal(null); // Returns Decimal(0) Copy
const amount = toDecimal("123.456");const price = toDecimal(99.99);const zero = toDecimal(null); // Returns Decimal(0)
Convert a string or number value to a Decimal instance. Returns Decimal(0) for null, undefined, or empty string values.