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

Function formatPrefix

external/.d3.js:9763–9771  ·  view source on GitHub ↗
(specifier, value)

Source from the content-addressed store, hash-verified

9761 }
9762
9763 function formatPrefix(specifier, value) {
9764 var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
9765 e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
9766 k = Math.pow(10, -e),
9767 prefix = prefixes[8 + e / 3];
9768 return function(value) {
9769 return f(k * value) + prefix;
9770 };
9771 }
9772
9773 return {
9774 format: newFormat,

Callers

nothing calls this directly

Calls 6

newFormatFunction · 0.85
formatSpecifierFunction · 0.85
exponentFunction · 0.85
maxMethod · 0.80
minMethod · 0.80
fFunction · 0.70

Tested by

no test coverage detected