MCPcopy Index your code
hub / github.com/apache/echarts / addCommas

Function addCommas

src/util/format.ts:32–39  ·  view source on GitHub ↗
(x: string | number)

Source from the content-addressed store, hash-verified

30 * Add a comma each three digit.
31 */
32export function addCommas(x: string | number): string {
33 if (!isNumeric(x)) {
34 return zrUtil.isString(x) ? x : '-';
35 }
36 const parts = (x + '').split('.');
37 return parts[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,')
38 + (parts.length > 1 ? ('.' + parts[1]) : '');
39}
40
41export function toCamelCase(str: string, upperCaseFirst?: boolean): string {
42 str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {

Callers 2

getLabelMethod · 0.90
makeValueReadableFunction · 0.85

Calls 1

isNumericFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…