UX: more work on a search function

This commit is contained in:
Pieter Vander Vennet 2024-08-21 14:06:42 +02:00
parent 3cd04df60b
commit 00ad21d5ef
30 changed files with 636 additions and 138 deletions

View file

@ -908,7 +908,7 @@ export class GeoOperations {
}
/**
* GeoOperations.distanceToHuman(52.8) // => "53m"
* GeoOperations.distanceToHuman(52.8) // => "50m"
* GeoOperations.distanceToHuman(2800) // => "2.8km"
* GeoOperations.distanceToHuman(12800) // => "13km"
*
@ -920,11 +920,11 @@ export class GeoOperations {
}
meters = Math.round(meters)
if (meters < 1000) {
return meters + "m"
return Utils.roundHuman(meters) + "m"
}
if (meters >= 10000) {
const km = Math.round(meters / 1000)
const km = Utils.roundHuman(meters / 1000)
return km + "km"
}