Skip to content

Commit

Permalink
2 decimal places for plugged-in voltage
Browse files Browse the repository at this point in the history
  • Loading branch information
prokrypt authored and andrekir committed Mar 13, 2024
1 parent 6fe1320 commit 59b67d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/com/geeksville/mesh/ui/BatteryInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fun BatteryInfo(
in 15..34 -> R.drawable.ic_battery_low to infoString
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)
101 -> R.drawable.ic_power_plug_24 to "%.2fV".format(voltage)
else -> R.drawable.ic_battery_unknown to (voltage?.let { "%.2fV".format(it) } ?: "")
}

Expand Down Expand Up @@ -91,4 +91,4 @@ class BatteryInfoPreviewParameterProvider : PreviewParameterProvider<Pair<Int?,
null to 4.5F,
null to null
)
}
}

0 comments on commit 59b67d4

Please sign in to comment.