@polkadot/util
Version:
A collection of useful utilities for @polkadot
12 lines (11 loc) • 315 B
JavaScript
/**
* Get the decimal and thousand separator of a locale
* @param locale
* @returns {decimal: string, thousand: string}
*/
export function getSeparator(locale) {
return {
decimal: (0.1).toLocaleString(locale).substring(1, 2),
thousand: (1000).toLocaleString(locale).substring(1, 2)
};
}