14 lines
398 B
TypeScript
14 lines
398 B
TypeScript
// components/pricing/money.ts
|
|
export function formatEUR(amount: number) {
|
|
return new Intl.NumberFormat("nl-NL", {
|
|
style: "currency",
|
|
currency: "EUR",
|
|
maximumFractionDigits: 0,
|
|
}).format(amount);
|
|
}
|
|
|
|
export function monthlyForYearly(baseMonthly: number, discount: number) {
|
|
// display as monthly equivalent when billed annually
|
|
return Math.round(baseMonthly * (1 - discount));
|
|
}
|