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

Support million, thousand etc. #86

Closed
kjk opened this issue Jun 24, 2017 · 13 comments
Closed

Support million, thousand etc. #86

kjk opened this issue Jun 24, 2017 · 13 comments
Milestone

Comments

@kjk
Copy link

kjk commented Jun 24, 2017

Currently "2 million" or "10 thousand" or "1 million / 10 thousand" are not recognized.

Those should be equivalent to "2 * 1 000 000", "10 * 1000" etc. i.e. unit-less multipliers.

@sharkdp
Copy link
Owner

sharkdp commented Jun 24, 2017

Thank you for the feedback!

I've never found myself needing this, but it has been requested multiple times now. What kind of words would you add? Only powers of ten?

@kjk
Copy link
Author

kjk commented Jun 24, 2017

Yes, what comes to mind are common quantities: ten, hundred, thousand, million, billion.

For me it comes up when doing calculations about e.g. money, where you might ask "how much is $1 million/year per month?".

It's easier to write "1 million / 12" than to count number of zeros when typing "1000000".

@perryprog
Copy link
Contributor

perryprog commented Jun 24, 2017

It would also be nice to have acronyms like "1m / 12". Could it also be possible to define your own? Maybe in some sort of config?

EDIT: "m" is taken by milli, maybe something like milli

@leipert
Copy link

leipert commented Jun 26, 2017

What about the financial abbrieviations like mn or bn?

@leipert leipert mentioned this issue Jun 26, 2017
@sunaku
Copy link

sunaku commented Jun 26, 2017

Why not use scientific notation which is already built-in? For example, a million is 1e6 and a billion is 1e9.

Edit: Insect raises an error when capital E is used, but lowercase e works fine, so use e instead. 💡

@perryprog
Copy link
Contributor

perryprog commented Jun 26, 2017 via email

@leipert
Copy link

leipert commented Jun 26, 2017

A reason would be: Not everyone knows scientific notation. You could also write 1 MN / N :)

@perryprog
Copy link
Contributor

perryprog commented Jun 26, 2017 via email

@leipert
Copy link

leipert commented Jun 26, 2017

simply: 1 MegaNewton divided by Newton :)

@perryprog
Copy link
Contributor

perryprog commented Jun 26, 2017 via email

@sharkdp
Copy link
Owner

sharkdp commented Aug 8, 2017

This is now supported. Would be great if someone could verify that this works as intended.

Examples:

>>> 1 million / 10 thousand

  1 × million / (10 × thousand)

   = 100

>>> 5 million kilogram -> tons

  5 × million × kg ➞ ton

   = 5000 ton

@perryprog
Copy link
Contributor

It looks like it works how I described. Don't forget to push to NPM! 😄

@sharkdp
Copy link
Owner

sharkdp commented Aug 8, 2017

Don't forget to push to NPM

Done: v4.9.0.

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

No branches or pull requests

5 participants