Added number formatting
This commit is contained in:
26
src/components/app/ListItem.vue
Normal file
26
src/components/app/ListItem.vue
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
name: String,
|
||||||
|
park: String,
|
||||||
|
length: String,
|
||||||
|
height: String,
|
||||||
|
speed: String
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<tr class="border-b dark:border-gray-700">
|
||||||
|
<th scope="row" class="px-4 py-3 font-medium text-gray-900 whitespace-nowrap dark:text-white">{{ name }}</th>
|
||||||
|
<td class="px-4 py-3">{{ park }}</td>
|
||||||
|
<td class="px-4 py-3">{{ length }}</td>
|
||||||
|
<td class="px-4 py-3">{{ height }}</td>
|
||||||
|
<td class="px-4 py-3">{{ speed }}</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
@@ -29,7 +29,7 @@ export default {
|
|||||||
this.stats.totalVisitorsPerMonth = Math.round(totalVisitors / parks.length);
|
this.stats.totalVisitorsPerMonth = Math.round(totalVisitors / parks.length);
|
||||||
|
|
||||||
const totalPrice = parks.reduce((sum: number, park: any) => {
|
const totalPrice = parks.reduce((sum: number, park: any) => {
|
||||||
const price = parseFloat(park.ticket_price.replace('€', '').replace(',', '.'));
|
const price = parseFloat(park.ticket_price);
|
||||||
return sum + price;
|
return sum + price;
|
||||||
}, 0);
|
}, 0);
|
||||||
this.stats.averageTicketPrice = parseFloat((totalPrice / parks.length).toFixed(2));
|
this.stats.averageTicketPrice = parseFloat((totalPrice / parks.length).toFixed(2));
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ export default {
|
|||||||
this.coaster = {
|
this.coaster = {
|
||||||
name: coasterData.name,
|
name: coasterData.name,
|
||||||
park: parkData.name,
|
park: parkData.name,
|
||||||
length: `${coasterData.length} m`,
|
length: `${coasterData.length?.toLocaleString('de-DE')} m`,
|
||||||
height: `${coasterData.height} m`,
|
height: `${coasterData.height?.toLocaleString('de-DE')} m`,
|
||||||
speed: `${coasterData.velocity} km/h`,
|
speed: `${coasterData.velocity} km/h`,
|
||||||
launch: coasterData.type,
|
launch: coasterData.type,
|
||||||
inversions: coasterData.inversions,
|
inversions: coasterData.inversions,
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export default {
|
|||||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4 text-gray-700 dark:text-gray-300 mt-4">
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4 text-gray-700 dark:text-gray-300 mt-4">
|
||||||
<div>
|
<div>
|
||||||
<span class="font-semibold">Ø Besucher / Monat:</span>
|
<span class="font-semibold">Ø Besucher / Monat:</span>
|
||||||
{{ park.averageVisitorsPerMonth }}
|
{{ park.averageVisitorsPerMonth?.toLocaleString('de-DE') }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="font-semibold">Ø Ticketpreis:</span>
|
<span class="font-semibold">Ø Ticketpreis:</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user