示例#1
0
        public static decimal ConvertValue(Unit fromUnit,
                                          Unit toUnit,
                                          decimal value)
        {
            if (fromUnit.GetGroup() == toUnit.GetGroup())
            {
                value = fromUnit.GetBaseValue(value);
                value = toUnit.GetUnitValue(value);
            }

            return value;
        }
示例#2
0
 public static decimal GetBaseValue(Unit unit, decimal value)
 {
     return unit.GetBaseValue(value);
 }