public ConvertTo ( String unit ) : Double>>.List |
||
unit | String | The unit (combination) to convert to. |
return | Double>>.List |
public static UnitValue Convert(UnitValue fromValue, String targetUnit) { var cu = new CombinedUnit(fromValue.Unit); var conversions = cu.ConvertTo(targetUnit); var re = fromValue.Re; foreach (var conversation in conversions) { re = conversation(re); } return(new UnitValue(cu.Factor * re, cu.Unit)); }
public static UnitValue Convert(UnitValue fromValue, String targetUnit) { var cu = new CombinedUnit(fromValue.Unit); var conversions = cu.ConvertTo(targetUnit); var re = fromValue.Re; foreach (var conversation in conversions) { re = conversation(re); } return new UnitValue(cu.Factor * re, cu.Unit); }