예제 #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));
 }