Complex Calculations
Below are some examples of calculations shared by the Adalo Community.
1. Rounding a Number to Nearest Hundredths Using *100/100
*100/100
If you want to round a number to two decimal places manually, you can multiply it by 100, round it, and then divide by 100 again. For example, to round the number 12.34567 to two decimal places:
This calculation works by:
Multiplying
12.34567
by 100 β1234.567
Rounding it to the nearest integer β
1235
Dividing by 100 to get it back to the original scale β
12.35
2. Calculating a Percentage Increase/Decrease
Letβs say you have a property for last yearβs revenue and another for this yearβs revenue, and you want to calculate the percentage increase:
This formula will:
Subtract last yearβs revenue from this yearβs revenue to get the difference.
Divide that difference by last yearβs revenue to calculate the change as a decimal.
Multiply by 100 to convert the result to a percentage.
3. Compound Interest Formula
To calculate compound interest, where you have a principal amount, an interest rate, and a number of periods (e.g., years), you can use the formula:
For example, if you invest $1,000 at an annual interest rate of 5% for 3 years, the formula would look like this:
This will calculate the total value after interest is compounded over 3 years.
4. Combining Rounding with Other Functions
You might want to round a calculated percentage to one decimal place. For example, if youβre calculating the percentage completion of a task and want to round it:
This formula:
Divides the number of completed tasks by the total tasks to get the completion rate as a decimal.
Multiplies by 100 to convert it into a percentage.
Rounds the result to one decimal place.
5. Adjusting Time Based on User Hours
If you want to adjust the current date by a partial day based on the userβs hours, you can use this formula:
This formula works by:
Subtracting
User_Hours
from 24 to get the remaining hours in the day.Dividing by 24 to convert the remaining hours into a fraction of a day.
Adding that fraction of a day to the
Current_Date
to adjust the time.
6. Simple Percentage Calculation
If you want to calculate what percentage a number (Part
) is of a total (Total
):
For example, if you completed 30 tasks out of 50, the formula would be:
7. Adding Days to a Date
To calculate a new date by adding a certain number of days to the current date, you can use:
For example, to add 7 days to todayβs date:
This will give you the date thatβs 7 days from now.
8. Calculating a Discount
If you want to calculate the discounted price of an item, you can subtract the discount from the original price:
For example, if an item costs $100 and there is a 20% discount, the formula would be:
Last updated