MAPG-119 add more area categories
This commit is contained in:
parent
805d91c0c0
commit
ff201c2e8e
@ -53,10 +53,18 @@ class MapsController
|
|||||||
|
|
||||||
private function formatMapAreaForHuman(float $area): array
|
private function formatMapAreaForHuman(float $area): array
|
||||||
{
|
{
|
||||||
if ($area < 100000.0) {
|
if ($area < 100.0) {
|
||||||
$digits = 0;
|
$digits = 0;
|
||||||
$rounded = round($area, 0);
|
$rounded = round($area, 0);
|
||||||
$unit = 'm';
|
$unit = 'm';
|
||||||
|
} elseif ($area < 100000.0) {
|
||||||
|
$digits = 0;
|
||||||
|
$rounded = round($area, -2);
|
||||||
|
$unit = 'm';
|
||||||
|
} elseif ($area < 1000000.0) {
|
||||||
|
$digits = 2;
|
||||||
|
$rounded = round($area / 1000000.0, 2);
|
||||||
|
$unit = 'km';
|
||||||
} elseif ($area < 100000000.0) {
|
} elseif ($area < 100000000.0) {
|
||||||
$digits = 0;
|
$digits = 0;
|
||||||
$rounded = round($area / 1000000.0, 0);
|
$rounded = round($area / 1000000.0, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user