From fa20d62fc2a27ec8f3a1c4dc0922d946100fe857 Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Fri, 13 Dec 2024 17:58:03 -0300 Subject: [PATCH] plotter: Parse inputs to number before fixing decimal places --- src/components/widgets/Plotter.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/widgets/Plotter.vue b/src/components/widgets/Plotter.vue index 23bee54bf..fa1567e23 100644 --- a/src/components/widgets/Plotter.vue +++ b/src/components/widgets/Plotter.vue @@ -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) }