Using Advanced Expression Piping within your forms you can create mathematical formulas in order to calculate a value. Using the PRECISION expression you can display the result of a function to a precise number of floating points. This article introduces the PRECISION expression by providing use cases and rules of proper formatting.

**In this Article...**

The PRECISION function allows the expression to accept two parameters where the second parameter is an integer indicating the precision used to calculate the first value. This allows the value to display up to a particular decimal point. This is one of the more commonly used functions within expression piping; it can be used to get a total from a simple list of variables (q1+q2+q3) or can be used for more complicated equations such as multiplying the sum of two parts together ( (q1+q2)*(q3+q4) to a set decimal place.

The PRECISION function would not actually round up the value to the set decimal place. In order to do so, you would need to add a half value to the decimal place one back to make it appear that the displayed value is rounding up to the decimal place. For example, the PRECISION is set for two places, the addition of the half value would be for the third decimal point (0.005).

**NOTE:** PRECISION must be used if you wish to set the floating point value to more than 2 places. If the floating point will be 1 or 2 points, consider using the REAL or REALTWO expressions instead.

The setup and formatting of the PRECISION expression is imperative in preventing an ** error** message from appearing on your form where the result of your expression would normally appear. The first line of the PRECISION expression should be set up as follows:

{{ PRECISION(variable1+variable2, n) }} |

**NOTE:** *n *represents the number of floating points to be displayed in the result.

- Each expression is always contained within a pair of double "curly" brackets {{ }}
- There should be a space between the first instance of PRECISION and the last bracket
- Variables you are using are case sensitive
- Always close each PRECISION operation with brackets ( )
- Include a numerical value to determine the Precise Point the result should appear to. For example, if the precise point is 3. The value will display to 3 decimal points

**PRECISION Examples with Operators**

What's different about PRECISION over some of the other functions is that PRECISION can be used in conjunction with other functions. For example, using the AVG Function, if we want to calculate the average of 3 values, should that value return a floating point, PRECISION can be used to ensure the value displays up to the specific decimal place specified.

PRECISION using addition |
{{ PRECISION(q1[0]+q1[1], 3) }} |
Ensures that the sum of q1[0] and q1[1] displays up to 3 decimal points. |

PRECISION using subtraction |
{{ PRECISION(q2[1]-q1[0], 2) }} |
Ensures that the difference of q2[1] and q1[0] displays up to two decimal points. |

PRECISION using multiplication |
{{ PRECISION(q1[1]*2, 4) }} OR (( PRECISION(q1[2]*q2[0], 4) }} |
Ensures the product of the multiplied values displays up to 4 decimal points. |

PRECISION using division |
{{ PRECISION(q1[3]/4, 5) }} OR {{ PRECISION(q2[0]/q1[1], 5) }} |
Ensures the quotient of the divided values displays up to 5 decimal points. |

PRECISION on another function |
{{ PRECISION(SUM(q1[:0]), 3) }} OR {{ PRECISION(AVG(q1[0],q1[2],[q1[3], 3) }} |
Ensure the result of the expression using another function displays up to 3 decimal points. |

**NOTE: **PRECISION will not round the value to the nearest number, it will simply remove any additional floating points to meet the Rule, therefore 1.69 will be 1.6 and not 1.7.