(x: string | number)
| 30 | * Add a comma each three digit. |
| 31 | */ |
| 32 | export 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 | |
| 41 | export function toCamelCase(str: string, upperCaseFirst?: boolean): string { |
| 42 | str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) { |
no test coverage detected
searching dependent graphs…