How to use the d3-format.formatDefaultLocale function in d3-format

To help you get started, we’ve selected a few d3-format examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / d3-format / d3-format-tests.ts View on Github external
thousands: "\u066c",
  grouping: [3],
  currency: ["", ""],
  percent : "\u202f%"
};

let decimal: string = localeDef.decimal;
let thousands: string = localeDef.thousands;
let grouping: number[] = localeDef.grouping;
let currency: [string, string] = localeDef.currency;
let numerals: string[] | undefined = localeDef.numerals;
let percent: string | undefined = localeDef.percent;

localeObj = d3Format.formatLocale(localeDef);

localeObj = d3Format.formatDefaultLocale(localeDef);

let formatFactory: (specifier: string) => ((n: number) => string) = localeObj.format;
let formatPrefixFactory: (specifier: string, value: number) => ((n: number) => string) = localeObj.formatPrefix;
github DefinitelyTyped / DefinitelyTyped / d3-format / d3-format-tests.ts View on Github external
decimal: "\u066b",
  thousands: "\u066c",
  grouping: [3],
  currency: ["", ""],
  numerals : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"]
}

let decimal: string = localeDef.decimal;
let thousands: string = localeDef.thousands;
let grouping: Array = localeDef.grouping;
let currency: [string, string] = localeDef.currency;
let numerals: string[] | undefined = localeDef.numerals;

localeObj = d3Format.formatLocale(localeDef);

localeObj = d3Format.formatDefaultLocale(localeDef);

let formatFactory: (specifier: string) => ((n: number) => string) = localeObj.format;
let formatPrefixFactory: (specifier: string, value: number) => ((n: number) => string) = localeObj.formatPrefix;