replaced hardcoded € with intl.numberformat and created config .state.priceOverallInEur

This commit is contained in:
zino
2021-05-27 11:12:05 +02:00
parent 01560a5c20
commit 6ba97e46f7
7 changed files with 106 additions and 59 deletions

View File

@@ -7,20 +7,18 @@ export function setBtnCartText(): void {
function createCartBtnText(): string {
const numTickets: number = config.state.selectedSeatsArr.length;
if (config.state.priceOverall !== "")
return numTickets === 1 ? `${numTickets} Ticket für €${config.state.priceOverall}` : `${numTickets} Tickets für €${config.state.priceOverall}`;
else
return "0 Tickets für €0.00";
return numTickets === 1 ? `${numTickets} Ticket für ${config.state.priceOverallEur}` : `${numTickets} Tickets für ${config.state.priceOverallEur}`;
}
function createModalCartBtnText(): string {
const numTickets: number = config.state.selectedSeatsArr.length;
if (config.state.priceOverall !== "")
return `Summe (${numTickets} Plätze) €${config.state.priceOverall}`;
else
return `Summe (0 Plätze) €0,00`;
return `Summe (${numTickets} Plätze) ${config.state.priceOverallEur}`;
// if (config.state.priceOverall !== "")
// return `Summe (${numTickets} Plätze) €${config.state.priceOverall}`;
// else
// return `Summe (0 Plätze) €0,00`;
}
export function showHideBtnCartLoading(inSwitch: string): void {