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

tpl/inflect: Add the SI function to format numbers with SI notation #12563

Closed
wants to merge 1 commit into from

Conversation

razonyang
Copy link
Contributor

@razonyang razonyang commented Jun 2, 2024

https://en.wikipedia.org/wiki/Metric_prefix

One of use case of mine: a repository card.

image

Not sure if I put this function into the right place/package.

@jmooring
Copy link
Member

jmooring commented Jun 3, 2024

How would I use this with the lang.FormatSomething functions? Each of these functions returns a string. I imagine in some locales you might want 12,3 kb instead of 12.3 kb.

Maybe this should be lang.FormatNumberSI, and possibly create derivatives of lang.FormatNumberCustom and lang.FormatCurrency as well.

I suggest closing this PR and opening a proposal to work out the details.

@razonyang
Copy link
Contributor Author

razonyang commented Jun 3, 2024

I imagine in some locales you might want 12,3 kb instead of 12.3 kb.

Haven't thought about this.

Done, create a topic on forum, which might be visible to much more developers.

Close PR for now.

@razonyang razonyang closed this Jun 3, 2024
@razonyang razonyang deleted the feat-inflect-si branch June 18, 2024 10:03
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

Successfully merging this pull request may close these issues.

None yet

2 participants