From 9ed824e94ad09262202b16aa9fc01c34e245ad4c Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Fri, 15 Sep 2023 20:41:04 +0200 Subject: [PATCH] refactor: round remaining weight in spoolman panel Signed-off-by: Stefan Dej --- src/components/panels/SpoolmanPanel.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/panels/SpoolmanPanel.vue b/src/components/panels/SpoolmanPanel.vue index 9a1173a2e..93d72ff03 100644 --- a/src/components/panels/SpoolmanPanel.vue +++ b/src/components/panels/SpoolmanPanel.vue @@ -106,11 +106,12 @@ export default class SpoolmanPanel extends Mixins(BaseMixin) { } get weightOutput() { - const remaining = this.active_spool?.remaining_weight ?? null + let remaining = this.active_spool?.remaining_weight ?? null let total = this.active_spool?.filament.weight ?? null let unit = 'g' if (remaining === null || total === null) return null + remaining = Math.round(remaining) let totalRound = Math.floor(total / 1000) if (total >= 1000) {