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

Function formatSpecifier

external/.d3.js:9537–9552  ·  view source on GitHub ↗
(specifier)

Source from the content-addressed store, hash-verified

9535var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
9536
9537function formatSpecifier(specifier) {
9538 if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
9539 var match;
9540 return new FormatSpecifier({
9541 fill: match[1],
9542 align: match[2],
9543 sign: match[3],
9544 symbol: match[4],
9545 zero: match[5],
9546 width: match[6],
9547 comma: match[7],
9548 precision: match[8] && match[8].slice(1),
9549 trim: match[9],
9550 type: match[10]
9551 });
9552}
9553
9554formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
9555

Callers 4

newFormatFunction · 0.85
formatPrefixFunction · 0.85
tickFormatFunction · 0.85
loggishFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected