## Calculation question - how to round the answer up

## Calculation question - how to round the answer up

(OP)

I have a calculation field of: field1/500. That calculation field is working; however, the answer has to round up.

Example: $4,235,623.00/500=$8471.246 The answer of $8471.246 has to round UP to the next whole number. I tried making the answer 0 decimal points but it then follows the .50> up, .49< rounds down. I thought it may have to be written as a javascript, but I'm not sure how to do that. Anyone have any ideas? Your input would be appreciated. Thanks!

Example: $4,235,623.00/500=$8471.246 The answer of $8471.246 has to round UP to the next whole number. I tried making the answer 0 decimal points but it then follows the .50> up, .49< rounds down. I thought it may have to be written as a javascript, but I'm not sure how to do that. Anyone have any ideas? Your input would be appreciated. Thanks!

## RE: Calculation question - how to round the answer up

the "Ceiling" function is your friend:

## CODE

Will that do?

"Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family." (Kofi Annan)

Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

## RE: Calculation question - how to round the answer up

## RE: Calculation question - how to round the answer up

However one of the following should work:

In properties, change calculation to "user-defined calculation script", enter

## CODE

FormCalc is different to Javascript.

In Javascript you could also add a Javascript action to the Lost Focus or Mouse out event of field1:

## CODE

"Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family." (Kofi Annan)

Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

## RE: Calculation question - how to round the answer up