.dcss-precision-prefix
Tells you the precision an SI-prefix format needs for steps of a given size at a given value.
Example
Result
Markup
<link rel="stylesheet" href="dcss.css">
<link rel="stylesheet" href="families/array.css">
<link rel="stylesheet" href="families/format.css">
<div class="dcss-precision-prefix" style="--step: 100000; --value: 1300000">
<output class="dcss-format-fixed" style="--value: var(--dcss-precision-prefix); --precision: 0"></output>
</div>
Browser support
| Browser | Support |
|---|---|
| Chrome | Yes |
| Safari | Yes |
| Firefox | Whole numbers only |
See also
d3.precisionPrefixin d3’s documentation