// https://github.com/apache/incubator-echarts/blob/master/src/util/format.js#L30
export function addCommas(x) {
if (isNaN(x)) {
return '-';
}
x = (x + '').split('.');
return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,')
+ (x.length > 1 ? ('.' + x[1]) : '');
}