d3-format icon indicating copy to clipboard operation
d3-format copied to clipboard

near-zero and near-100 rounding option

Open ianstormtaylor opened this issue 3 years ago • 0 comments

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.

ianstormtaylor avatar Jan 23 '21 06:01 ianstormtaylor