File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
TankAlarm-112025-Viewer-BluesOpta Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ static const char VIEWER_DASHBOARD_HTML[] PROGMEM = R"HTML(
237237 <tr>
238238 <th>Site</th>
239239 <th>Tank</th>
240- <th>Level (in)</th>
240+ <th>Level (ft/ in)</th>
241241 <th>24hr Change</th>
242242 <th>Updated</th>
243243 </tr>
@@ -382,7 +382,7 @@ static const char VIEWER_DASHBOARD_HTML[] PROGMEM = R"HTML(
382382 tr.innerHTML = `
383383 <td>${escapeHtml(tank.site, '--')}</td>
384384 <td>${escapeHtml(tank.label || 'Tank')} #${escapeHtml((tank.tank ?? '?'))}</td>
385- <td>${formatNumber (tank.levelInches)}</td>
385+ <td>${formatFeetInches (tank.levelInches)}</td>
386386 <td>--</td>
387387 <td>${formatEpoch(tank.lastUpdate)}</td>`;
388388 tbody.appendChild(tr);
@@ -401,6 +401,13 @@ static const char VIEWER_DASHBOARD_HTML[] PROGMEM = R"HTML(
401401 return (typeof val === 'number' && isFinite(val)) ? val.toFixed(1) : '--';
402402 }
403403
404+ function formatFeetInches(inches) {
405+ if (typeof inches !== 'number' || !isFinite(inches)) return '--';
406+ const feet = Math.floor(inches / 12);
407+ const remainingInches = inches % 12;
408+ return `${feet}' ${remainingInches.toFixed(1)}"`;
409+ }
410+
404411 function formatEpoch(epoch) {
405412 if (!epoch) return '--';
406413 const date = new Date(epoch * 1000);
You can’t perform that action at this time.
0 commit comments