Exported wrapper of the GWT NumberFormat, plus LongWrapper support

Utility class to parse and format numbers, using the same format patterns as are supported by the standard Java implementation used in the Deephaven server and swing client. Works for numeric types including BigInteger and BigDecimal.

Hierarchy

  • NumberFormat

Constructors

  • Creates a new number format instance. This generally should be avoided in favor of the static getFormat function, which will create and cache an instance so that later calls share the same instance.

    Parameters

    • pattern: string

    Returns NumberFormat

Methods

  • Formats the specified number (or Java long, BigInteger or BigDecimal value) using this instance's pattern.

    Parameters

    Returns string

    String

  • Parses the given text using this instance's pattern into a JS Number.

    Parameters

    • text: string

    Returns number

    double

  • Returns string

  • Formats the specified number (or Java long, BigInteger or BigDecimal value) using the cached format matching the given pattern string.

    Parameters

    Returns string

    String

  • a number format instance matching the specified format. If this format has not been specified before, a new instance will be created and cached for later reuse. Prefer this method to calling the constructor directly to take advantage of caching

    Parameters

    • pattern: string

    Returns NumberFormat

    dh.i18n.NumberFormat

  • Parses the given text using the cached format matching the given pattern.

    Parameters

    • pattern: string
    • text: string

    Returns number

    double