Skip to content

Commit a4b8846

Browse files
Keith BannisterKeith Bannister
Keith Bannister
authored and
Keith Bannister
committed
Fix decimal places
1 parent 585c96e commit a4b8846

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dashboard.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,12 @@ function onMessageArrived(message) {
120120

121121
addData(temperatureChart, mqtt_message_count, [data.internal_temp, data.external_temp, data.esc_temp, data.relative_humidity])
122122

123-
$('#battery_voltage').html(`${data.battery_voltage} V`);
124-
$('#controller_temp').html(`${data.esc_temp} Deg.`);
125-
$('#rpm').html(`${data.rpm} RPM`);
123+
let voltStr = data.battery_voltage.toFixed(1) + ' V';
124+
let tempStr = data.esc_temp.toFixed(1) + ' Deg.';
125+
let rpmStr = data.rpm.toFixed(0);
126+
$('#battery_voltage').html(voltStr);
127+
$('#controller_temp').html(tempStr);
128+
$('#rpm').html(rpmStr);
126129

127130
mqtt_message_count += 1;
128131

0 commit comments

Comments
 (0)