MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / addCommas

Function addCommas

libs/echarts/echarts-en.simple.js:19332–19339  ·  view source on GitHub ↗

* add commas after every three numbers * @param {string|number} x * @return {string}

(x)

Source from the content-addressed store, hash-verified

19330 * @return {string}
19331 */
19332function addCommas(x) {
19333 if (isNaN(x)) {
19334 return '-';
19335 }
19336 x = (x + '').split('.');
19337 return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,')
19338 + (x.length > 1 ? ('.' + x[1]) : '');
19339}
19340
19341/**
19342 * @param {string} str

Callers 3

setEachItemFunction · 0.70
formatSingleValueFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected