.. highlightlang:: us .. index:: units_get_scale .. _units_get_scale: units_get_scale =============== .. us.tag units_get_scale NOTREADYENGLISH units New5511 :ref:`units_get_scale` returns the factor and offset to convert the data from one unit to the other. .. function:: rvScale = units_get_scale(oUnit, ssFrom, ssTo) .. us.return **Return Value** *rvScale* is a vector with two elements. *rvScale[1]* is the factor and *rvScale[2]* is the offset. If one of the units is invalid (not in the table), the return value is ``[0,0]``. .. us.params **Parameters** .. uparam:: oUnit Units-Converter-Objekt, see :ref:`units`. .. uparam:: ssFrom *ssFrom* is a unit from the unit or alias table (see :ref:`overview-units`). If *ssFrom* is an empty string, the return value is scaling from the SI unit to the *ssTo* unit. .. uparam:: ssTo *ssTo* is the result unit. If *ssTo* is an empty string the Scaling to the SI unit is returned. .. us.comment **Comment** The ``units_get_scale(oUnit, ssFrom, ssTo)`` can also be invoked in the following form: ``oUnit.scale(ssFrom, ssTo)``. .. us.example **Example** :: u = units() rvScale = units_get_scale(u, "PS") rvScale 735.4987 0.0000 P_ps = 100 P_watt = rvScale[1] * P_ps + rvScale[2]; 73549.8749 rvScale = u.scale("PS", "kW") P_kW = rvScale[1] * P_ps + rvScale[2] P_kW 73.5499 .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2013.11 - New. .. seealso:: :ref:`overview-units`, :ref:`units` :sub:`id-1218826`