Permalink
Browse files

Merge pull request #8 from josher19/master

Can now use convertUnit to round to 0 decimal places.
  • Loading branch information...
2 parents d3fa444 + 0e90fd7 commit 390e9d4e26c05bfdba86fe1a28a8548c58a9b841 @manuelbieh manuelbieh committed Mar 15, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 geolib.js
View
@@ -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) {

0 comments on commit 390e9d4

Please sign in to comment.