Skip to content

[I] Numeric

An immutable numeric value that preserves precision beyond JavaScript’s number range.

PropertyModifierTypeDescription
isIntegerreadonlybooleanWhether the value has no fractional component, regardless of its source notation.
asBigInt(): bigint | null;

Convert an integer to a signed bigint, or return null for a fractional value.

bigint | null


asNumber(): number | null;

Convert to a JavaScript number, returning null when a finite conversion loses precision. Throws on overflow to infinity. Use Numeric.toString to retain the precise value without conversion.

number | null


equals(value): boolean;

Compare normalized digits and exponent; unlike ordering comparisons, this does not compare signs.

ParameterType
valueNumeric

boolean


gt(value): boolean;

Test strict greater-than ordering without converting to a JavaScript number.

ParameterType
valueNumeric

boolean


gte(value): boolean;

Test greater-than-or-equal ordering without converting to a JavaScript number.

ParameterType
valueNumeric

boolean


lt(value): boolean;

Test strict less-than ordering without converting to a JavaScript number.

ParameterType
valueNumeric

boolean


lte(value): boolean;

Test less-than-or-equal ordering without converting to a JavaScript number.

ParameterType
valueNumeric

boolean


toString(): string;

Format a base-10 value without exponential notation.

string