mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-15 10:17:20 -04:00
Fix truncation of environmental metrics when using Celsius (#667)
This commit is contained in:
@@ -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) +
|
||||
|
||||
Reference in New Issue
Block a user