Skip to content

Commit

Permalink
changed number of decimals for short distances
Browse files Browse the repository at this point in the history
  • Loading branch information
ppete2 authored Nov 7, 2023
1 parent 3413729 commit 9908e5a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Leaflet.PolylineMeasure.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
** **
** Leaflet Plugin "Leaflet.PolylineMeasure" **
** File "Leaflet.PolylineMeasure.js" **
** Date: 2023-08-05 **
** Date: 2023-11-07 **
** **
*********************************************************/

Expand Down Expand Up @@ -643,7 +643,7 @@
dist = (dist/1609.344).toFixed(2);
} else {
if (!this.options.useSubunits) {
dist = (dist/1609.344).toFixed(3);
dist = (dist/1609.344).toFixed(4);
} else {
dist = (dist/0.3048).toFixed(0);
unit = this.options.unitControlLabel.feet;
Expand All @@ -660,9 +660,9 @@
dist = (dist/1000).toFixed(2);
} else {
if (!this.options.useSubunits) {
dist = (dist/1000).toFixed(3);
dist = (dist/1000).toFixed(4);
} else {
dist = (dist).toFixed(2);
dist = (dist).toFixed(1);
unit = this.options.unitControlLabel.metres;
}
}
Expand Down

0 comments on commit 9908e5a

Please sign in to comment.