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

near-zero and near-100 rounding option #109

Open
ianstormtaylor opened this issue Jan 23, 2021 · 0 comments
Open

near-zero and near-100 rounding option #109

ianstormtaylor opened this issue Jan 23, 2021 · 0 comments

Comments

@ianstormtaylor
Copy link

Right now using a simple percent format like:

const f = format('.1%')

Gives misleading results near 0 and 100:

f(0.0001) // 0.0%
f(0.9999) // 100.0%

Even though these are technically correct from a rounding perspective, they lead to confusion for users because it reads as "absolute". Which is why it's common to instead refer these as:

<0.1%
>99.9%

It would be really nice if there was a flag for this style of percentage formatting.

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

No branches or pull requests

1 participant