MCPcopy Create free account
hub / github.com/d3/d3-shape / formatNumber

Function formatNumber

test/asserts.js:13–15  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

11}
12
13function formatNumber(s) {
14 return Math.abs((s = +s) - Math.round(s)) < 1e-6 ? Math.round(s) : s.toFixed(3);
15}
16
17export function assertInDelta(actual, expected, delta) {
18 delta = delta || 1e-6;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected