MCPcopy Create free account
hub / github.com/microsoft/SandDance / FormatSpecifier

Function FormatSpecifier

docs/app/js/sanddance-app.js:15488–15499  ·  view source on GitHub ↗
(specifier)

Source from the content-addressed store, hash-verified

15486exports.default = formatSpecifier;
15487formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
15488function FormatSpecifier(specifier) {
15489 this.fill = specifier.fill === undefined ? " " : specifier.fill + "";
15490 this.align = specifier.align === undefined ? ">" : specifier.align + "";
15491 this.sign = specifier.sign === undefined ? "-" : specifier.sign + "";
15492 this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "";
15493 this.zero = !!specifier.zero;
15494 this.width = specifier.width === undefined ? undefined : +specifier.width;
15495 this.comma = !!specifier.comma;
15496 this.precision = specifier.precision === undefined ? undefined : +specifier.precision;
15497 this.trim = !!specifier.trim;
15498 this.type = specifier.type === undefined ? "" : specifier.type + "";
15499}
15500FormatSpecifier.prototype.toString = function() {
15501 return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === undefined ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
15502};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected