/// <summary> /// Gets the amount of this measure in the requested unit /// </summary> /// <param name="iUnit">Unit to which the measured amount should be converted</param> /// <returns>Measured amount converted into <paramref name="iUnit">specified unit</paramref></returns> public AmountType GetAmount(IUnit <Q> iUnit) { if (iUnit == null) { throw new ArgumentNullException("iUnit"); } return(iUnit.AmountFromStandardUnitConverter(mAmount)); }
/// <summary> /// Gets the amount of this measure in the requested unit /// </summary> /// <param name="iUnit">Unit to which the measured amount should be converted</param> /// <returns>Measured amount converted into <paramref name="iUnit">specified unit</paramref></returns> AmountType IMeasure.GetAmount(IUnit iUnit) { if (iUnit == null) { throw new ArgumentNullException("iUnit"); } if (!iUnit.Quantity.Equals(default(Q))) { throw new ArgumentException("Unit is not the same quantity as measure"); } return(iUnit.AmountFromStandardUnitConverter(mAmount)); }