Commit ff8d7ada authored by 轩辕Rowboat's avatar 轩辕Rowboat Committed by Pan

千分符考虑小数点

parent bf480ca6
......@@ -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, ',');
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment