/// <summary> /// Returns distance converted to selected unit. If distance has no value, null is returned. /// </summary> /// <param name="targetUnit"></param> /// <returns></returns> public double?GetDistanceIn(Common.eDistanceUnit targetUnit) { if (Distance.HasValue == false) { return(null); } double ret = Common.Convert(Distance.Value.Value, DistanceUnit, targetUnit); return(ret); }
/// <summary> /// Returns cloud altitude in selected distance unit. /// </summary> /// <param name="distanceUnit"></param> /// <returns></returns> public double GetAltitudeIn(Common.eDistanceUnit distanceUnit) { double ret = 0; int inFt = this.Altitude * 100; if (distanceUnit == Common.eDistanceUnit.ft) { ret = inFt; } else { ret = Common.Convert(inFt, Common.eDistanceUnit.ft, distanceUnit); } return(ret); }