Files
twenty_crm/front/src/utils/formatNumber.ts
Lucas Bordeau 9b5e24105b Refactor/display input part 2 (#1555)
* Email - Money - Number

* Date
2023-09-12 11:04:26 -07:00

5 lines
190 B
TypeScript

export function formatNumber(value: number) {
// Formats the value to a string and add commas to it ex: 50,000 | 500,000
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}