fix eslint && refine code

This commit is contained in:
Pan
2017-06-23 15:39:13 +08:00
parent 1072572ac6
commit 7549eb8044
2 changed files with 17 additions and 20 deletions

View File

@@ -104,8 +104,5 @@ export function html2Text(val) {
export function toThousandslsFilter(num) {
return (+num || 0).toString()
.replace(/^\-?\d+/g, function (m) {
return m.replace(/(?=(?!\b)(\d{3})+$)/g, ',');
});
return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','));
}