fix(profile): Format total distance
This commit is contained in:
parent
59cb42c336
commit
480fe3e0e5
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user