API Docs for: 3.8.0
Show:

Number Class

Number provides a set of utility functions to operate against Number objects.

Item Index

Methods

Methods

format

(
  • data
  • config
)
HTML

Takes a Number and formats to string for display to user.

Parameters:

  • data Number

    Number.

  • config Object

    (Optional) Optional configuration values:

    prefix {HTML}
    String prepended before each number, like a currency designator "$"
    decimalPlaces {Number}
    Number of decimal places to round. Must be a number 0 to 20.
    decimalSeparator {HTML}
    Decimal separator
    thousandsSeparator {HTML}
    Thousands separator
    suffix {HTML}
    String appended after each number, like " items" (note the space)

Returns:

HTML: Formatted number for display. Note, the following values return as "": null, undefined, NaN, "".

parse

(
  • data
)
Number

Provided by the datatype-number-parse module.

Defined in number/js/number-parse.js:12

Converts data to type Number.

Parameters:

  • data String | Number | Boolean

    Data to convert. The following values return as null: null, undefined, NaN, "".

Returns:

Number: A number, or null.