1.1.0 • Published 2 years ago

@telefonica/number-formatter v1.1.0

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
2 years ago

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 tests
  • yarn lint: check codestyle
  • yarn build: build package
  • yarn watch: build package and watch for changes
  • yarn clean: remove generated files