Using Floor and Ceiling in a Number Calculation to Round Up and Round Down

You can now use floor and ceiling in an equation to round any number in your forms to a lower and an upper whole number.

You can set a number to round up or down to the nearest whole number in a calculation field

You can set a number to round up or down to the nearest whole number in a calculation field

The image here shows that the field of Score has been rounded down to the nearest whole number, and the field Score has also been rounded up the nearest whole number using floor and ceiling functions in an equation field.

Assume there is a question "20m" is a number, and entered as 2.4

ceiling(20m) will result in 3

floor(20m) will result in 2

Ceiling rounds up and floor rounds down.

To round a number up to the nearest whole number, add in a calculation field

To round a number up to the nearest whole number, add in a calculation field

In the equation area write which field you want to round up. In this example the field "Score" will be rounded up

In the equation area write which field you want to round up. In this example the field "Score" will be rounded up

To round a number down to the nearest whole number, again choose a calculation field

To round a number down to the nearest whole number, again choose a calculation field

Write floor for the field you want to round down.  In this example the field "Score" will be rounded down

Write floor for the field you want to round down.  In this example the field "Score" will be rounded down

The image here shows how the number is rounded up, or rounded down depending on the floor and ceiling functions in the calculation fields

The image here shows how the number is rounded up, or rounded down depending on the floor and ceiling functions in the calculation fields

0 Comments

Add your comment

E-Mail me when someone replies to this comment