@telefonica/number-formatter
v1.1.0
Published
This package transforms a number to a string, taking in account locale thousand and decimal separators and the desired number of decimals to show.
Downloads
161
Readme
number-formatter
This package transforms a number to a string, taking in account locale thousand and decimal separators and the desired number of decimals to show.
API
formatNumber(number: number, locale?: Locale = 'default', {numDecimals = 2, alwaysDisplayDecimals = false}): number
Returns the string equivalent of the number passed in. For more info on the locales supported check
localeSeparators
.
Development
yarn test
: run testsyarn lint
: check codestyleyarn build
: build packageyarn watch
: build package and watch for changesyarn clean
: remove generated files