Using Calculations
Calculations allow you to process the data collected from fields and display results. They are essential for creating dynamic and informative widgets like calculators.
-
Creating Calculations:
-
Title and Description: Give each calculation a clear title and a brief description of what it calculates.
-
Formula: Define the formula that will process the user inputs. Formulas can include basic arithmetic operations like addition, subtraction, multiplication, and division.
-
-
Configuring Calculations:
-
Data Source: Use the input from the fields as variables in your formula. For example, you might use the number of hours slept and stress level to calculate a sleep quality score.
-
Result Format: Specify the format of the result, such as a number, percentage, or currency.
-
-
Example Calculation:
-
Sleep Quality Score: A formula combining hours of sleep, stress level, physical activity, and caffeine intake to estimate a sleep quality score.
(10 - Stress Level) + (Hours of Sleep * 1.5) + (Physical Activity / 10) - (Caffeine Intake * 1.5)
-
Example: Configuring a Sleep Quality Calculator
-
Adding Fields:
-
Hours of Sleep (Slider): Set the range from 0 to 12 hours with steps of 0.1.
-
Stress Level (Dropdown): Provide options for Low, Moderate, and High.
-
Physical Activity (Slider): Set the range from 0 to 120 minutes with steps of 5.
-
Caffeine Intake (Dropdown): Provide options for None, Low, Moderate, and High.
-
-
Setting Conditions:
-
Show the "Caffeine Intake" dropdown only if the "Include Caffeine Intake" checkbox is checked.
-
-
Creating Calculations:
-
Sleep Quality Score: Combine the inputs to calculate a sleep quality score using the formula provided above.
-
That's it! Hope we helps :)
Comments
0 comments
Please sign in to leave a comment.