Skip to content

Commit

Permalink
Fix odometer number format (#9345)
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis authored Aug 11, 2023
1 parent 45836c5 commit f096716
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assets/js/components/ChargingSessionModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export default {
modal.show();
},
formatKm: function (value) {
return `${distanceValue(value)} ${distanceUnit()}`;
return `${this.fmtNumber(distanceValue(value), 0)} ${distanceUnit()}`;
},
async changeVehicle(index) {
await this.updateSession({
Expand Down
4 changes: 3 additions & 1 deletion assets/js/components/TargetSocSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
import LabelAndValue from "./LabelAndValue.vue";
import AnimatedNumber from "./AnimatedNumber.vue";
import { distanceUnit } from "../units";
import formatter from "../mixins/formatter";
export default {
name: "TargetSocSelect",
components: { LabelAndValue, AnimatedNumber },
mixins: [formatter],
props: {
targetSoc: Number,
rangePerSoc: Number,
Expand Down Expand Up @@ -69,7 +71,7 @@ export default {
return `${Math.round(value)}%`;
},
formatKm: function (value) {
return `${Math.round(value)} ${distanceUnit()}`;
return `${this.fmtNumber(value, 0)} ${distanceUnit()}`;
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion assets/js/components/Vehicle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class="flex-grow-1"
:label="$t('main.vehicle.vehicleSoc')"
:value="vehicleSoc ? `${Math.round(vehicleSoc)}%` : '--'"
:extraValue="range ? `${Math.round(range)} ${rangeUnit}` : null"
:extraValue="range ? `${fmtNumber(range, 0)} ${rangeUnit}` : null"
align="start"
/>
<LabelAndValue
Expand Down

0 comments on commit f096716

Please sign in to comment.