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
decimalSeparator
option. (BREAKING CHANGE) - Added
locales
option to format number into different languages.
- Ensured
MillifyOptions
interface 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)
Options
interface name toMillifyOptions
. (BREAKING CHANGE)
base
from options. We only intend to support the common grouping base (1000). (BREAKING CHANGE)
- Update
yargs
dependency version.
- Update README code example.
- Revert to default export in millify.js.
- Replace TSLint with ESLint.
- Use a single named export
millify
instead of default export.
- Outputs an empty suffix if units array is not sufficient length.
- Renamed
lowerCase
option 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
null
values (thanks @dbankier).
- Make
options
parameter 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
units
to override default suffixes. - Option
space
to add a space between digit and suffix. - Option
decimalSeparator
to override default decimal separator. - Git hooks for code linting.
- New tests.
- Changelog.
- Dependency on
round-to
package.
- ESLint and Prettier for code lint/formatting.
- Option
lowerCase
to output result in lower case. - Greater test coverage.
- Second function parameter to be an object for options. (BREAKING CHANGE)
- Renamed
decimal
option toprecision
. (BREAKING CHANGE) - Replaced mocha test library with ava.
- Created
src
directory for library code.