Skip to content

Commit 4ca32f3

Browse files
authored
Update value.md (d3#3796)
Fix example code for interpolateRound()
1 parent 6e37f0a commit 4ca32f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/d3-interpolate/value.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Avoid interpolating to or from the number zero when the interpolator is used to
5757
[Examples](https://observablehq.com/@d3/d3-interpolatenumber) · [Source](https://github.com/d3/d3-interpolate/blob/main/src/round.js) · Returns an interpolator between the two numbers *a* and *b*.
5858

5959
```js
60-
d3.interpolateNumber(20, 620)(0.821) // 513
60+
d3.interpolateRound(20, 620)(0.821) // 513
6161
```
6262

6363
The interpolator is similar to [interpolateNumber](#interpolateNumber) except it will round the resulting value to the nearest integer.

0 commit comments

Comments
 (0)