UtilUnitConversionFactors Method (eumUnit, eumUnit, Double, Double, Boolean) |
In case of success, the factor and offset contains the conversion values, that will convert from source to target using
target = source*factor + offset
The method will fail if one of the units are undefined, or if the units are not equivalent and unitsMustBeEquivalent is set. On failure, default values are used (scale is 1 and offset is 0). and false is returned
It can handle units that are not equivalent, i.e. if the target is kg/m3 and the source is g/s, and there is some processing (in proper units) between the target and the source, the conversion will take care of the factor 1000 here.
Namespace: DHI.Mike1D.Generic
public static bool UnitConversionFactors( eumUnit targetUnit, eumUnit sourceUnit, out double factor, out double offset, bool unitsMustBeEquivalent )