Пример #1
0
        public Quantity Convert(Unit u)
        {
            var a = Unit.ToBase(amount);

            a = u.FromBase(a);
            return(new Quantity(a, u));
        }
Пример #2
0
 private double ConvertTo(double d, Unit u)
 {
     if (ReferenceEquals(null, u))
     {
         return(double.NaN);
     }
     if (!IsSameMeasure(u))
     {
         return(double.NaN);
     }
     d = Unit.ToBase(d);
     return(u.FromBase(d));
 }