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

Function appendRound

external/.d3.js:11946–11962  ·  view source on GitHub ↗
(digits)

Source from the content-addressed store, hash-verified

11944}
11945
11946function appendRound(digits) {
11947 const d = Math.floor(digits);
11948 if (!(d >= 0)) throw new RangeError(`invalid digits: ${digits}`);
11949 if (d > 15) return append;
11950 if (d !== cacheDigits) {
11951 const k = 10 ** d;
11952 cacheDigits = d;
11953 cacheAppend = function append(strings) {
11954 let i = 1;
11955 this._ += strings[0];
11956 for (const j = strings.length; i < j; ++i) {
11957 this._ += Math.round(arguments[i] * k) / k + strings[i];
11958 }
11959 };
11960 }
11961 return cacheAppend;
11962}
11963
11964function index$2(projection, context) {
11965 let digits = 3,

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected