mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
add distance unit test and fix bug reported via crashyltics
This commit is contained in:
parent
3e29ebe0c0
commit
49ed2b8e1f
2 changed files with 23 additions and 1 deletions
|
|
@ -125,7 +125,7 @@ data class NodeInfo(
|
|||
fun distanceStr(o: NodeInfo?) = distance(o)?.let { dist ->
|
||||
when {
|
||||
dist == 0 -> null // same point
|
||||
dist < 1000 -> "%.0f m".format(dist)
|
||||
dist < 1000 -> "%.0f m".format(dist.toDouble())
|
||||
else -> "%.1f km".format(dist / 1000.0)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue