跳至主要内容
Adaptive Planning
Concept: Rounding with Formulas

Concept: Rounding with Formulas

Adaptive Planning formulas support rounding and truncating.

Rounding

To round a value with decimals to the nearest whole number, you can use the Round function. The Round function rounds the number up or down.
Example: Round(ACCT.001).
Value of ACCT.001:
Formula Returns:
3.45
3
7.798
8

Truncating

Truncating removes numbers after the decimal. The function effectively always rounds down to the nearest whole number.
Example: Trunc(ACCT.001).
Value of ACCT.001:
Formula Returns:
3.45
3
7.798
7

Advanced Rounding

To round to the 10s place, or the 100s place, and so on, you can use the Round functions in advanced formulas.
Example: Round(divf(ACCT.001,10))*10.
The formula says: First divide the value by 10, then round the result to the nearest whole number. Finally multiply the result by 10.
Value of ACCT.001:
The Formula Returns:
43
40:
  1. 43/10 = 4.3
  2. Rounding 4.3 to the nearest whole number = 4
  3. 4*10 = 40
876
880:
  1. 876/10 = 87.6
  2. Rounding  87.6to nearest whole number = 88
  3. 88*10 = 880
To round to the nearest 100, replace both 10s with 100. To round the nearest 1000, replace both 10s with 1000, and so on. You can also round to numbers after the decimal. To round the nearest 10th, replace the 10s with .1. To round to the 100th place, replace the 10s with .01 and so on.

Advanced Truncating

To truncate to the nearest 10s, or the nearest 100s, and so on, you can use the Trunc function in advanced formulas.
Example: Trunc(divf(ACCT.001,10))*10.
The formula says: Divide the account by 10. Then, truncate the result. Finally, multiply the result by 10.
Value of ACCT.001:
Formula Returns:
47
40:
  1. 47/10 = 4.7
  2. 4.7 truncated to whole number = 4
  3. 4*10 = 40
133
133:
  1. 133/10 = 13.3
  2. 13.3 truncated to whole number = 13
  3. 13*10 = 130
To truncate to the 100s, replace both 10s with 100. To truncate to the 1000s, replace both 10s with 1000, and so on.  You can also truncate to numbers after the decimal. To round the nearest 10th, replace the 10s with .1. To round to the 100th place, replace the 10s with .01 and so on.