mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Fix truncation of environmental metrics when using Celsius (#667)
This commit is contained in:
parent
242dc76081
commit
75eebb989e
1 changed files with 2 additions and 2 deletions
|
|
@ -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) +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue