Skip to content
Snippets Groups Projects
Commit ff8d7ada authored by 轩辕Rowboat's avatar 轩辕Rowboat Committed by Pan
Browse files

千分符考虑小数点

parent bf480ca6
No related branches found
No related tags found
No related merge requests found
......@@ -104,5 +104,8 @@ export function html2Text(val) {
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, ',');
});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment