Skip to content

Commit

Permalink
plotter: Parse inputs to number before fixing decimal places
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl committed Dec 16, 2024
1 parent 7698ae7 commit fa20d62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/widgets/Plotter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ const renderCanvas = (): void => {
ctx.textBaseline = 'bottom'
// Draw the values
drawText(ctx, `Current: ${currentValue.toFixed(2)}`, 10, canvasHeight - 10)
drawText(ctx, `Min: ${minValue.toFixed(2)}`, 10, canvasHeight - 30)
drawText(ctx, `Max: ${maxValue.toFixed(2)}`, 10, canvasHeight - 50)
drawText(ctx, `Current: ${Number(currentValue).toFixed(2)}`, 10, canvasHeight - 10)
drawText(ctx, `Min: ${Number(minValue).toFixed(2)}`, 10, canvasHeight - 30)
drawText(ctx, `Max: ${Number(maxValue).toFixed(2)}`, 10, canvasHeight - 50)
} catch (error) {
console.error('Error drawing graph:', error)
}
Expand Down

0 comments on commit fa20d62

Please sign in to comment.