千分符考虑小数点

pull/92/head
轩辕Rowboat 8 years ago committed by Pan
parent bf480ca6b4
commit ff8d7ada73

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

Loading…
Cancel
Save