MCPcopy Create free account
hub / github.com/breck7/scroll / formatDecimal

Function formatDecimal

external/.d3.js:9482–9486  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

9480}
9481
9482function formatDecimal(x) {
9483 return Math.abs(x = Math.round(x)) >= 1e21
9484 ? x.toLocaleString("en").replace(/,/g, "")
9485 : x.toString(10);
9486}
9487
9488// Computes the decimal coefficient and exponent of the specified number x with
9489// significant digits p, where x is positive and p is in [1, 21] or undefined.

Callers

nothing calls this directly

Calls 2

replaceMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected