billing-helpers: Add commas to formatted amount.

This commit is contained in:
sbansal1999
2023-04-30 11:41:22 +05:30
committed by Tim Abbott
parent 263ee4cb86
commit 7c68a30363
2 changed files with 10 additions and 6 deletions

View File

@@ -75,8 +75,10 @@ export function format_money(cents) {
} else {
precision = 2;
}
// TODO: Add commas for thousands, millions, etc.
return (cents / 100).toFixed(precision);
return new Intl.NumberFormat("en-US", {
minimumFractionDigits: precision,
maximumFractionDigits: precision,
}).format((cents / 100).toFixed(precision));
}
export function update_charged_amount(prices, schedule) {