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

Function formatFloat

docs/app/js/sanddance-app.js:109986–110001  ·  view source on GitHub ↗
(spec)

Source from the content-addressed store, hash-verified

109984 format,
109985 formatPrefix,
109986 formatFloat (spec) {
109987 const s = (0, _d3Format.formatSpecifier)(spec || ",");
109988 if (s.precision == null) {
109989 s.precision = 12;
109990 switch(s.type){
109991 case "%":
109992 s.precision -= 2;
109993 break;
109994 case "e":
109995 s.precision -= 1;
109996 break;
109997 }
109998 return trimZeroes(format(s), format(".1f")(1)[1] // decimal point character
109999 );
110000 } else return format(s);
110001 },
110002 formatSpan (start, stop, count, specifier) {
110003 specifier = (0, _d3Format.formatSpecifier)(specifier == null ? ",f" : specifier);
110004 const step = (0, _d3Array.tickStep)(start, stop, count), value = Math.max(Math.abs(start), Math.abs(stop));

Callers

nothing calls this directly

Calls 2

trimZeroesFunction · 0.70
formatFunction · 0.70

Tested by

no test coverage detected