All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Defaults to browser locales from
navigator.languages
- Update readme
- Fix publish
- Dropped
decimalSeparatoroption. (BREAKING CHANGE) - Added
localesoption to format number into different languages.
- Ensured
MillifyOptionsinterface is published to npm
- Graceful fallback of invalid values instead of throwing error. (BREAKING CHANGE)
- Error converting a nullish value to string (undefined, null)
- Bug causing "1000T" instead of "1M" (#25)
- Returns the original number if no unit is available.
- Default precision to 1 instead of 2. (BREAKING CHANGE)
Optionsinterface name toMillifyOptions. (BREAKING CHANGE)
basefrom options. We only intend to support the common grouping base (1000). (BREAKING CHANGE)
- Update
yargsdependency version.
- Update README code example.
- Revert to default export in millify.js.
- Replace TSLint with ESLint.
- Use a single named export
millifyinstead of default export.
- Outputs an empty suffix if units array is not sufficient length.
- Renamed
lowerCaseoption tolowercase(no breaking change).
- Update dependencies.
- Catch and log errors in the command line.
- Change workflow to publish on tag push events.
- Reduce size of packaged tarball by removing source files.
- Prevent infinite loop but caused by
nullvalues (thanks @dbankier).
- Make
optionsparameter optional.
- Logic to decipher unit index.
- Convert project to Typescript.
- Updated dependencies.
- Completely rewrite logic and refactor library core.
- Ability to run package from CLI.
- Option
unitsto override default suffixes. - Option
spaceto add a space between digit and suffix. - Option
decimalSeparatorto override default decimal separator. - Git hooks for code linting.
- New tests.
- Changelog.
- Dependency on
round-topackage.
- ESLint and Prettier for code lint/formatting.
- Option
lowerCaseto output result in lower case. - Greater test coverage.
- Second function parameter to be an object for options. (BREAKING CHANGE)
- Renamed
decimaloption toprecision. (BREAKING CHANGE) - Replaced mocha test library with ava.
- Created
srcdirectory for library code.