Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #8 from josher19/master

Can now use convertUnit to round to 0 decimal places.
  • Loading branch information...
commit 390e9d4e26c05bfdba86fe1a28a8548c58a9b841 2 parents d3fa444 + 0e90fd7
@manuelbieh authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 geolib.js
View
5 geolib.js
@@ -739,7 +739,8 @@
* Converts a distance from meters to km, mm, cm, mi, ft, in or yd
*
* @param string Format to be converted in
- * @param float Distance
+ * @param float Distance in meters
+ * @param float Decimal places for rounding (default: 4)
* @return float Converted distance
*/
convertUnit: function(unit, distance, round) {
@@ -756,7 +757,7 @@
}
unit = unit || 'm';
- round = round || 4;
+ round = (null == round ? 4 : round);
switch(unit) {
Please sign in to comment.
Something went wrong with that request. Please try again.