1
0
mirror of https://github.com/d3/d3.git synced 2026-02-01 16:41:44 +00:00

Update value.md (#3796)

Fix example code for interpolateRound()
This commit is contained in:
M Wong 2023-11-03 11:11:27 -04:00 committed by GitHub
parent 6e37f0a615
commit 4ca32f39c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,7 @@ Avoid interpolating to or from the number zero when the interpolator is used to
[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*.
```js
d3.interpolateNumber(20, 620)(0.821) // 513
d3.interpolateRound(20, 620)(0.821) // 513
```
The interpolator is similar to [interpolateNumber](#interpolateNumber) except it will round the resulting value to the nearest integer.