Fix truncation of environmental metrics when using Celsius (#667)

This commit is contained in:
Jonathan Bennett authored and GitHub committed 2023-07-27 05:45:04 -03:00
1 parent 242dc76081
commit 75eebb989e
1 file changed
+2 -2
@@ -175,8 +175,8 @@ data class NodeInfo(
if (env != null && env != 0f) String.format(f + unit, env) else ""
fun envMetricStr(isFahrenheit: Boolean = false): String =
if (!isFahrenheit) envFormat("%.1f", "°C ", environmentMetrics?.temperature)
else envFormat("%.1f", "°F ", environmentMetrics?.temperature?.times(1.8f)?.plus(32)) +
(if (!isFahrenheit) envFormat("%.1f", "°C ", environmentMetrics?.temperature)
else envFormat("%.1f", "°F ", environmentMetrics?.temperature?.times(1.8f)?.plus(32))) +
envFormat("%.0f", "%% ", environmentMetrics?.relativeHumidity) +
envFormat("%.1f", "hPa ", environmentMetrics?.barometricPressure) +
envFormat("%.0f", "MΩ ", environmentMetrics?.gasResistance) +