Thanks to visit codestin.com
Credit goes to docs.fluentforms.com

Skip to content

Numeric Calculation

Numeric calculation in Fluent Forms runs math on Numeric fields in real time as users fill out your form. Use it for order totals, quotes, scoring, or any case where one field should update automatically from others.

This guide shows you how to enable a calculation expression, build a formula with field shortcodes and operators (+, -, *, /), and preview the result on your site. For field basics, see Numeric Input Field in Fluent Forms.

Adding Numeric Fields

First, go to the Forms section from the Fluent Forms Navbar, choose a desired Form, and click the Edit icon to open the Editor page of that form.

NOTE

If you do not have any existing forms, read Create a Form from Scratch or Create a Form using Templates to create a new one.

If you want to learn more about the Numeric Input Field, read the Numeric Input Field documentation.

Editor Fluent Forms

Now add two numeric fields ( "Number One" and "Number Two"). Then, add a third numeric field to display the calculation result ("Result").

Three Numeric Field

Enable Calculation Expression

Now hover over the Result field (where you want to show the result) and click the Edit (pencil) Icon. In the right sidebar, go to Advanced Options.

Now, click on the Enable Calculation option from the Advanced Option to activate the calculation box.

Enable Calculations Expression Numeric Calculation

Define the Calculation

Now, click on the Document Icon, and it will show all the available input fields.

Select the numeric fields to be used in the calculation ( Number One, Number Two).

Now add a mathematical operator between them ( +, -, *, /).

  • Example: Number One + Number Two

Avoid spaces between fields and operators. For a better understanding, see the screenshot below.

Document Icon

Embed the Form into the Front

Once you complete the customization, click the Save Form button to save all your changes. Click the Preview & Design button in the middle to see the form preview.

To integrate and display the form on a specific Page or post, copy the Shortcode from the top right side and paste it into your desired Page or post.

Save Numeric Calculation

Preview of Added Numeric Calculation

Here is a preview of the form with the Numeric calculation.

Preview Numeric Calculation

Conversational Forms Support

Fluent Forms also supports calculations in Conversational Forms, enabling dynamic responses based on user input.

Example

If you have an order form where a user selects the number of items, you can calculate the total price dynamically: Quantity * Price Per Item = Total Price

Supported Symbols

SymbolExplanation
+Addition Operator eg. 2+3 results 5
Subtraction Operator eg. 2-3 results -1
/Division operator eg 3/2 results in 1.5
*Multiplication Operator eg. 2*3 results 6
ModModulus Operator eg. 3 Mod 2 results 1
(Opening Parenthesis
)Closing Parenthesis
SigmaSummation eg. Sigma(1,100,n) results 5050
PiProduct eg. Pi(1,10,n) results 3628800
nVariable for Summation or Product
piMath constant pi returns 3.14
eMath constant e returns 2.71
CCombination operator eg. 4C2 returns 6
PPermutation operator eg. 4P2 returns 12
!factorial operator eg. 4! returns 24
loglogarithmic function with base 10 eg. log 1000 returns 3
lnnatural log function with base e eg. ln 2 returns .3010
powpower function with two operator pow(2,3) returns 8
^power operator eg. 2^3 returns 8
rootunderroot function root 4 returns 2
sinSine function
cosCosine function
tanTangent function
asinInverse Sine function
acosInverse Cosine funtion
atanInverse Tangent funtion
sinhHyperbolic Sine function
coshHyperbolic Cosine function
tanhHyperbolic Tangent function
asinhInverse Hyperbolic Sine function
acoshInverse Hyperbolic Cosine function
atanhInverse Hyperbolic Tangent function
roundMake a number a decimal/integer.Use case: round(3.235723663, 2) = 3.24 and round(3.235723663, 0) = 3
ceilUse case: ceil(3.235723663) = 4
floorUse case: floor(3.235723663) = 3
maxUse case: max(10, 15) = 15
minUse case: min(10, 15) = 10

So, this is the easy process of adding Numeric Calculation of your form.