By using a script within a calculated field, you can perform arithmetic operations that involve multiple fields in your form.

For instance, if you want to multiply fields 'A' and 'B', you can use this script:

Flokzu.getFieldValue([[A]]) * Flokzu.getFieldValue([[B]])

While this script works and is valid, it is possible that multiplying numbers with decimals results in an infinite number of decimals. To avoid this, we can modify the function in the following way and limit the number of digits after the decimal point to 3.

( Flokzu.getFieldValue([[A]]) * Flokzu.getFieldValue([[B]]) ).toFixed(3)

If you want to set a different number of digits, just change the 3.

For instance, if you want to multiply fields 'A' and 'B', you can use this script:

Flokzu.getFieldValue([[A]]) * Flokzu.getFieldValue([[B]])

While this script works and is valid, it is possible that multiplying numbers with decimals results in an infinite number of decimals. To avoid this, we can modify the function in the following way and limit the number of digits after the decimal point to 3.

( Flokzu.getFieldValue([[A]]) * Flokzu.getFieldValue([[B]]) ).toFixed(3)

If you want to set a different number of digits, just change the 3.

Published on: 23 / 11 / 2017