Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

significant digits? #17

Open
cainlevy opened this issue Jun 30, 2020 · 1 comment
Open

significant digits? #17

cainlevy opened this issue Jun 30, 2020 · 1 comment

Comments

@cainlevy
Copy link

I would like to specify a maximum number of significant digits for a number, so that I may better estimate how much space to allocate in design. Currently I may only specify precision and control decimals.

Currently:

  • millify(123456, {precision: 2}) returns 123.45K

Proposed:

  • millify(123456, {digits: 3}) returns 123K
  • millify(1234, {digits: 3}) returns 1.23K.

I'm willing to work on a patch if this is in scope for millify.

@amaljosea
Copy link

@cainlevy I think we need that, this library has an option for it. Going for it for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants