Can now use convertUnit to round to 0 decimal places. #8

Merged
merged 1 commit into from Mar 15, 2012
View
5 geolib.js
@@ -510,7 +510,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) {
@@ -527,7 +528,7 @@
}
unit = unit || 'm';
- round = round || 4;
+ round = (null == round ? 4 : round);
switch(unit) {