--- title: "Assigning numeric values with units" slug: "fre-unit-number-input-vo-assign-unit-number" updated: 2026-05-07T12:58:00Z published: 2026-05-07T12:58:00Z canonical: "docs.lobstersoftware.com/fre-unit-number-input-vo-assign-unit-number" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Assigning numeric values with units Numeric values with units can be assigned by one of the following methods in the context of a form: - The target field is defined as a **Calculation field** and the calculation returns a numeric value with a unit as a result. - A [Set value](/v1/docs/en/freaction-set-value) action transfers the value of one numeric attribute to another and both feature elements for units. Both methods work with the form elements containing the value, while the associated units are involved without being addressed explicitly. The effects of assigning a combination of value and unit to a target element are determined by the following principles: - If the target element does not feature a unit so far, value and unit are both assigned to the target. - If the target element features a unit already, this choice for unit is maintained. - If the [Unit conversion](/v1/docs/en/fre-unit-number-input-vo-unit-conversions) is applicable from the unit of the assigned value to the target unit, the converted value is assigned for the target. - If the [Unit conversion](/v1/docs/en/fre-unit-number-input-vo-unit-conversions) is not applicable from the unit of the assigned value to the target unit, the target assumes the assigned value directly. **![images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/warning.svg](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/warning(38).svg) IMPORTANT**![images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/warning.svg](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/warning(38).svg) Unit are only considered within an input form, if they are represented by elements in the design of the form. These elements are not required to be *visible* but must be *included*, otherwise the units are completely ignored by the assignment and conversion mechanisms described here. The following examples illustrate the dependencies: | **Input for assignment** | | **Target (original values)** | | **Target (after assignment)** | **Remarks** | | --- | --- | --- | --- | --- | --- | | **Value** | **Unit** | **►** | **Unit** | **=** | **Value** | **Unit** | | | 1.25 | m | ► | (empty) | = | 1.25 | m | Assignment of value and unit | | 1.25 | m | ► | cm | = | 125 | cm | Assignment of value converted to target unit | | 1.25 | m | ► | m³ | = | 1.25 | m³ | Assignment of value without conversion | **►NOTE◄** Unit conversion in the second example is applied regardless of the setting for the **Convert** value option for the [Combobox](/v1/docs/en/fre-combo-box-vo) representing the target unit, but only if this element is part of the form design (see the "Important" notice above). Configuration example for "Set value" action: As an example, a value entered for **Loading volume** with a unit of choice should be converted to another selectable unit by the click of a button. ![images/download/attachments/34217110/image2019-4-12_11-45-40-version-1-modificationdate-1555062343000-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2019-4-12_11-45-40-version-1-modificationdate-1555062343000-api-v2.png) When the **Convert** button is clicked, a [Validate element](/v1/docs/en/frebehav-validate) behavior validates the value element (#231) for the **Loading volume** and returns the **Value** (via `$input`) to a [Set value](/v1/docs/en/freaction-set-value) action targeting the value element (#234) for **Loading volume (converted)**. As long as "convertible" combinations of units are selected, clicking the button assigns the correct value in the target unit. Instead of the button, changing the target unit could also trigger the calculation. ![images/download/attachments/34217110/image2019-4-12_11-53-4-version-1-modificationdate-1555062786000-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2019-4-12_11-53-4-version-1-modificationdate-1555062786000-api-v2.png) Configuration example for assigning a value by calculation: For the same task as above, **Loading volume (converted)** could be defined as a **Calculation field.** The calculation to define is merely a direct reference to the value of field #231 ("Loading volume"). With **Change types** set to "All", the calculation is updated whenever the value or unit of the referenced field changes. ![images/download/attachments/34217110/image2019-4-12_12-1-44-version-1-modificationdate-1555063306000-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2019-4-12_12-1-44-version-1-modificationdate-1555063306000-api-v2.png) Configuration example with calculation and conversion: For a shipment, the values entered for **Length** and **Width** (including the choice of unit) serve as input for a calculation of the **Loading meter** (typically defined by 1 ldm =Length [in m] x Width [in m] / 2.4): ![images/download/attachments/34217110/image2019-4-12_12-7-46-version-1-modificationdate-1555063668000-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2019-4-12_12-7-46-version-1-modificationdate-1555063668000-api-v2.png) The **ldm** unit was introduced as a custom [Length unit](/v1/docs/en/core-length-unit) for this purpose, with a conversion factor of 2.4 to the base unit **m** (see [Unit conversion](/v1/docs/en/fre-unit-number-input-vo-unit-conversions)). This enables the following configuration in a form: ![images/download/attachments/34217110/image2019-4-12_13-27-32-version-1-modificationdate-1555068455000-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2019-4-12_13-27-32-version-1-modificationdate-1555068455000-api-v2.png) - The values for the length and width are addressed by the element ids (187, 190) enclosed in wavy brackets. - The **Convert** (see [Calculate value](/v1/docs/en/core-calculate-value-resolver)) function is used to convert both inputs values to meters (m). - Once more, **Convert** is used to convert the product of both factors to loading meters (ldm). This conversion applies the conversion factor as specified in the custom entry for [Length unit](/v1/docs/en/core-length-unit). > [!NOTE] > **NOTE:** > > As shown in the screenshots, the form features an element indicating the "unit" for the "value" of the **Loading meter**. The calculation returns a value with the applicable unit **ldm**, which is also visible in the upper screenshot. A crucial point to consider in form design is, that the **ldm** unit from the calculation result will only be assigned for the target, if the target does not specify any unit before. If a shipment already contains a unit for the loading meter attribute, for example, because loading meters were populated using unit **m** (meters) earlier, the calculated **ldm** value will be converted to **m** when assigned, which will neutralize the effect of the conversion factor 2.4. Consequently, the form will indicate 3,6 m instead of 1,50 ldm. Combined with a label text of the **Loading meter**, this could be easily misread, although the indication could be switched from **m** to **ldm** to clearly indicate 1,50 ldm, provided the option **Convert** values is checked for the [Combobox](/v1/docs/en/fre-combo-box-vo). If the case of a data object carrying another unit than **ldm** for loading meters can be excluded, the following configuration might be used as well: ![images/download/attachments/34217110/image2019-4-12_14-1-21-version-1-modificationdate-1555070484000-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2019-4-12_14-1-21-version-1-modificationdate-1555070484000-api-v2.png) - This changed **Calculation expression** will return a value with unit **m**, although this is technically incorrect for a product of m x m. - When this result is assigned to the **Loading meter** element using a unit of **ldm** (initialized by default, if empty) meters are converted to ldm automatically.