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

Add an option to number_to_human for short labels #54

Open
Billzabob opened this issue Dec 8, 2021 · 0 comments · May be fixed by #55
Open

Add an option to number_to_human for short labels #54

Billzabob opened this issue Dec 8, 2021 · 0 comments · May be fixed by #55

Comments

@Billzabob
Copy link

The labels are currently hardcoded to Thousand, Million, Billion, Trillion, or Quadrillion. It would be nice to be able to pass a list of these yourself as one of the options, similar to how millify does it. For example:

iex> Number.Human.number_to_human(1440000, units: ["B", "KB", "MB", "GB", "TB"])
1.44 MB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants