Skip to content

Commit

Permalink
refactor: round remaining weight in spoolman panel
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Sep 15, 2023
1 parent 24d7e6c commit 9ed824e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/panels/SpoolmanPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9ed824e

Please sign in to comment.