fix: Round commas in manouvers

This commit is contained in:
Piotr Dec 2024-07-14 00:15:06 +02:00
parent 406831ad20
commit bb9a497a73
Signed by: stawros
GPG key ID: F89F27AD8F881A91

View file

@ -36,6 +36,7 @@ class ManeuverMapper {
}
}
}
"left" -> {
when (this.type) {
"turn" -> state.direction.outAngle = OutAngle.Left
@ -46,11 +47,14 @@ class ManeuverMapper {
this.stepDistance.apply {
this.distanceRemaining?.apply {
distanceFormatter.formatDistance(distanceRemaining!!).split(" ").apply {
state.distance = this[0].toInt()
// TODO: Send double
state.distance = this[0].replace(',', '.').toDouble().toInt()
state.unit = when (this[1]) {
"m" -> Unit.Metres
"km" -> Unit.Kilometres
else -> {Unit.Any}
else -> {
Unit.Any
}
}
}