mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Restore voltage precision to 2 places (#889)
This commit is contained in:
parent
9e54787a7d
commit
1468b26d3b
1 changed files with 2 additions and 2 deletions
|
|
@ -24,7 +24,7 @@ fun BatteryInfo(
|
|||
batteryLevel: Int?,
|
||||
voltage: Float?
|
||||
) {
|
||||
val infoString = "%d%% %.1fV".format(batteryLevel, voltage)
|
||||
val infoString = "%d%% %.2fV".format(batteryLevel, voltage)
|
||||
val (image, level) = when (batteryLevel) {
|
||||
in 0 .. 4 -> R.drawable.ic_battery_alert to " $infoString"
|
||||
in 5 .. 14 -> R.drawable.ic_battery_outline to infoString
|
||||
|
|
@ -32,7 +32,7 @@ fun BatteryInfo(
|
|||
in 35..79 -> R.drawable.ic_battery_medium to infoString
|
||||
in 80..100 -> R.drawable.ic_battery_high to infoString
|
||||
101 -> R.drawable.ic_power_plug_24 to "%.1fV".format(voltage)
|
||||
else -> R.drawable.ic_battery_unknown to (voltage?.let { "%.1fV".format(it) } ?: "")
|
||||
else -> R.drawable.ic_battery_unknown to (voltage?.let { "%.2fV".format(it) } ?: "")
|
||||
}
|
||||
|
||||
Row(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue