We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf480ca commit ff8d7adCopy full SHA for ff8d7ad
src/filters/index.js
@@ -104,5 +104,8 @@ export function html2Text(val) {
104
105
106
export function toThousandslsFilter(num) {
107
- return (+num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
+ return (+num || 0).toString()
108
+ .replace(/^\-?\d+/g, function(m){
109
+ return m.replace(/(?=(?!\b)(\d{3})+$)/g, ',');
110
+ });
111
}
0 commit comments