UNPKG
d3-format
Version:
latest (3.1.0)
next (3.0.0-rc.1)
3.1.0
3.0.1
3.0.0
3.0.0-rc.2
3.0.0-rc.1
2.0.0
2.0.0-rc.1
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.2
1.3.1
1.3.0
1.2.2
1.2.1
1.2.0
1.1.1
1.1.0
1.0.2
1.0.1
1.0.0
0.6.0
0.5.1
0.5.0
0.4.2
0.4.1
0.4.0
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.3.1
0.3.0
0.2.3
0.2.2
0.2.1
0.0.0
Format numbers for human consumption.
d3js.org/d3-format/
d3/d3-format
d3-format
/
src
/
precisionRound.js
7 lines
(5 loc)
•
189 B
JavaScript
View Raw
1
2
3
4
5
6
7
import
exponent
from
"./exponent.js"
;
export
default
function
(
step, max
) { step =
Math
.
abs
(step), max =
Math
.
abs
(max) - step;
return
Math
.
max
(
0
,
exponent
(max) -
exponent
(step)) +
1
; }