Represents a number instance containing a numeric value.

interface NumberInstance {
    Value: number;
    ToExponential(fractionDigits?: number): string;
    ToFixed(fractionDigits?: number): string;
    ToLocaleString(): string;
    valueOf(): number;
}

Properties

Value: number

The primitive numeric value.

Methods

  • Converts the number into a string in exponential notation.

    Parameters

    • OptionalfractionDigits: number

      The number of digits after the decimal point (0-20).

    Returns string

    The number represented in exponential notation.

  • Converts the number into a string in fixed-point notation.

    Parameters

    • OptionalfractionDigits: number

      The number of digits after the decimal point (0-20, default: 0).

    Returns string

    The number represented in fixed-point notation.

  • Returns a locale-aware string representation of the number.

    Returns string

    The number as a localized string.

  • Returns the primitive numeric value of the number instance.

    Returns number