MCPcopy Index your code
hub / github.com/microsoft/SandDance / formatPrefix

Function formatPrefix

docs/app/js/sanddance-app.js:15396–15401  ·  view source on GitHub ↗
(specifier, value1)

Source from the content-addressed store, hash-verified

15394 return format;
15395 }
15396 function formatPrefix(specifier, value1) {
15397 var f = newFormat((specifier = (0, _formatSpecifierJsDefault.default)(specifier), specifier.type = "f", specifier)), e = Math.max(-8, Math.min(8, Math.floor((0, _exponentJsDefault.default)(value1) / 3))) * 3, k = Math.pow(10, -e), prefix = prefixes[8 + e / 3];
15398 return function(value) {
15399 return f(k * value) + prefix;
15400 };
15401 }
15402 return {
15403 format: newFormat,
15404 formatPrefix: formatPrefix

Callers 1

formatSpanFunction · 0.70

Calls 4

newFormatFunction · 0.70
fFunction · 0.70
maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected