Skip to content

@camera.ui/sdk / manager / fromUnitSystem

Function: fromUnitSystem() ​

fromUnitSystem(value, unit, system): number

Defined in: manager/units.ts:93

Convert a value entered in the shown unit back to the unit it is stored in, the reverse of toUnitSystem.

Parameters ​

value ​

number

The value as entered.

unit ​

string

Unit the value is stored in, such as °C.

system ​

UnitSystem

The installation's unit system, from coreManager.getUnitSystem().

Returns ​

number

The value in the stored unit, rounded to two decimals.

Example ​

typescript
const stored = fromUnitSystem(70.7, '°C', UnitSystem.Imperial); // 21.5