automatically switch session log energy unit (#8371)

Show the charged energy in the session log table and details in Wh for
values below 1 kWh and in kWh for larger values
This commit is contained in:
Jan Alexander 2023-06-12 23:36:02 +02:00 • committed by GitHub
parent 1ba4698b8b
commit 57232cbbfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -67,7 +67,12 @@
{{ $t("sessions.energy") }}
</th>
<td>
{{ fmtKWh(session.chargedEnergy * 1e3) }}
{{
fmtKWh(
session.chargedEnergy * 1e3,
session.chargedEnergy >= 1
)
}}
</td>
</tr>
<tr v-if="session.solarPercentage != null">

View file

@ -90,7 +90,12 @@
{{ session.vehicle }}
</td>
<td class="text-end">
{{ fmtKWh(session.chargedEnergy * 1e3) }}
{{
fmtKWh(
session.chargedEnergy * 1e3,
session.chargedEnergy >= 1
)
}}
</td>
<td class="text-end">
<span v-if="session.solarPercentage != null">