Modify the first argument (which is assumed to be given in the same units as this object) such that its value is given in SI (J,N,m,kg,s,C) The other arguments indicate the dimensionality of the value. For example, an acceleration has exponent 1 of length, and exponent -2 of time. In combination with convertFromSI, this function can be used to convert any value from any unit system to any other unit system. Whilst energy and force can be derived from the other four dimensions, they are included for convenience.
value | variant | value to modify |
energyDim | integer | exponent of energy |
forceDim | integer | exponent of force |
lengthDim | integer | exponent of length |
massDim | integer | exponent of mass |
timeDim | integer | exponent of time |
temperatureDim | integer | exponent of temperature |
perLengthDim | optional integer | 0 (the default) for most quantities. 1 for quantities that are 'per unit length', such as "mm˛/m". Similarly 2 and 3 for quantities that are per unit area or volume. |
Return value | none |
Example
To convert 25.4mm into inches
dist = 25.4
call getUnitSet("N,mm,t,s,C").convertToSI(dist, 0, 0, 1, 0, 0, 0)
call msgbox(dist) ' will show 0.0254
call getUnitSet("lbf,in,slinch,s,F").convertFromSI(dist, 0, 0, 1, 0, 0, 0)
call msgbox(dist) ' will show (approx) 1.0
Back to UnitSet
Back to Overview