Class: Numbr

numbr. Numbr

new Numbr(value, langopt)

A wrapper for numeral-like formatting
Parameters:
Name Type Attributes Description
value number
lang string <optional>
Source:

Methods

clone() → {Numbr}

Returns a new Numbr object with the same value and language as this Numbr.
Source:
Returns:
Type
Numbr

format(fmtopt, roundFnopt) → {string}

Formats the wrapped value according to fmt. By default, the format is compiled into a series of transformations and then cached globally, if you'd like to disable the caching feature, use numbr.cacheEnabled.
Parameters:
Name Type Attributes Default Description
fmt string <optional>
roundFn function <optional>
Math.round
Source:
Returns:
The formatted number
Type
string

set(num)

Sets the wrapped value
Parameters:
Name Type Description
num number
Source:

setLang(lang)

Sets the language for this Numbr. The provided language must be already loaded via numbr.loadLang.
Parameters:
Name Type Description
lang The language code
Source:

value() → {number}

Access to the wrapped value
Source:
Returns:
Type
number

valueOf() → {number}

Source:
Returns:
Type
number