public static double ConvertFromInchTo(double inch, VLUnitType type) { switch (type) { case VLUnitType.centimeter: return(inch * MmPerInch / 10); case VLUnitType.millimeter: return(inch * MmPerInch); default: throw new NotImplementedException("未实现该类型的单位换算"); } }
public static double ConvertToInch(double value, VLUnitType type) { switch (type) { case VLUnitType.centimeter: return(value / MmPerInch * 10); case VLUnitType.millimeter: return(value / MmPerInch); default: throw new NotImplementedException("未实现该类型的单位换算"); } }
public static double ConvertFromFootTo(double foot, VLUnitType type) { switch (type) { case VLUnitType.centimeter: return(foot * MmPerFoot / 10); case VLUnitType.millimeter: return(foot * MmPerFoot); default: throw new NotImplementedException("未实现该类型的单位换算"); } }