adding nautical league

The distance 5.556 km = 1 league, is put on the nautical league and used the English land league 4.828 to differentiate both units.
This commit is contained in:
Ángel Montero Lamas 2024-03-26 14:13:39 +01:00
parent cd3cd61881
commit 3cc3c98dca
2 changed files with 6 additions and 4 deletions

View file

@ -113,10 +113,11 @@ function editWorld() {
function toKilometer(v) {
if (unit === "km") return v;
else if (unit === "mi") return v * 1.60934;
else if (unit === "lg") return v * 5.556;
else if (unit === "vr") return v * 1.0668;
else if (unit === "nmi") return v * 1.852;
if (unit === "mi") return v * 1.60934;
if (unit === "lg") return v * 4.828;
if (unit === "vr") return v * 1.0668;
if (unit === "nmi") return v * 1.852;
if (unit === "nlg") return v * 5.556;
return 0; // 0 if distanceUnitInput is a custom unit
}