MCPcopy Create free account
hub / github.com/d3/d3-format / FormatSpecifier

Function FormatSpecifier

src/formatSpecifier.js:23–34  ·  view source on GitHub ↗
(specifier)

Source from the content-addressed store, hash-verified

21formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
22
23export function FormatSpecifier(specifier) {
24 this.fill = specifier.fill === undefined ? " " : specifier.fill + "";
25 this.align = specifier.align === undefined ? ">" : specifier.align + "";
26 this.sign = specifier.sign === undefined ? "-" : specifier.sign + "";
27 this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "";
28 this.zero = !!specifier.zero;
29 this.width = specifier.width === undefined ? undefined : +specifier.width;
30 this.comma = !!specifier.comma;
31 this.precision = specifier.precision === undefined ? undefined : +specifier.precision;
32 this.trim = !!specifier.trim;
33 this.type = specifier.type === undefined ? "" : specifier.type + "";
34}
35
36FormatSpecifier.prototype.toString = function() {
37 return this.fill

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…