e = typeof e === 'string' ? e : e.toString(); const pattern = /(-?\d+)(\d{3})/; while (pattern.test(e)) { e = e.replace(pattern, '$1,$2'); }
123.12 => 123 123#123 => 123