* Add a comma each three digit.
(x)
| 16430 | */ |
| 16431 | |
| 16432 | function addCommas(x) { |
| 16433 | if (!isNumeric(x)) { |
| 16434 | return isString(x) ? x : '-'; |
| 16435 | } |
| 16436 | |
| 16437 | var parts = (x + '').split('.'); |
| 16438 | return parts[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,') + (parts.length > 1 ? '.' + parts[1] : ''); |
| 16439 | } |
| 16440 | function toCamelCase(str, upperCaseFirst) { |
| 16441 | str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) { |
| 16442 | return group1.toUpperCase(); |
no test coverage detected
searching dependent graphs…