improved formatting

This commit is contained in:
2024-01-09 10:51:40 +01:00
parent c76a69df5b
commit e2a3c0baa1
2 changed files with 2 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
export const formatCurrency = (amount:number) => {
// format number wirh 2 decimal places and a thousand separator
// amount is in cents
const formattedAmount = (amount/100).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
return(formattedAmount);
}