From 34d4ffe9a4e8ce3363507da28a0149d6d5cc2a57 Mon Sep 17 00:00:00 2001 From: Michael Newton Date: Tue, 12 Dec 2017 14:43:55 -0800 Subject: [PATCH] update convenience functions --- src/usr/local/www/widgets/javascript/thermal_sensors.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/usr/local/www/widgets/javascript/thermal_sensors.js b/src/usr/local/www/widgets/javascript/thermal_sensors.js index 7d40c857eb..52ac153e67 100644 --- a/src/usr/local/www/widgets/javascript/thermal_sensors.js +++ b/src/usr/local/www/widgets/javascript/thermal_sensors.js @@ -164,7 +164,11 @@ function getThermalSensorValue(stringValue) { } function getFahrenheitValue(celc) { - return parseInt((celc * 1.8) + 32, 10); + return Math.ceil((celc * 1.8) + 32); +} + +function getCelciusValue(fahr) { + return Math.floor((fahr - 32) / 1.8); } // Update the progress indicator