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; }