fix(profile): Format total distance

This commit is contained in:
Nicolai Ort 2025-05-26 18:58:43 +02:00
parent 59cb42c336
commit 480fe3e0e5
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F

View File

@ -156,7 +156,7 @@
<div class="w-full mx-auto"> <div class="w-full mx-auto">
<div v-if="state.scans.length > 0"> <div v-if="state.scans.length > 0">
<p class="mb-2"> <p class="mb-2">
{{ $t('total_distance') }}: {{ getReadableDistanceForUI() }} {{ $t('total_distance') }}: {{ getTotalReadableDistance() }}
</p> </p>
<table class="table-auto w-full text-left whitespace-no-wrap"> <table class="table-auto w-full text-left whitespace-no-wrap">
@ -420,8 +420,8 @@ const props = defineProps({
}); });
const accesstoken = props.token; const accesstoken = props.token;
function getReadableDistanceForUI() { function getTotalReadableDistance() {
return state.scans.reduce((accumulator, currentValue) => accumulator + currentValue.distance, 0) return getReadableDistance(state.scans.reduce((accumulator, currentValue) => accumulator + currentValue.distance, 0));
} }
function getReadableDistance(distance) { function getReadableDistance(distance) {