How can I set up a field to round the result of a calculation to the nearest whole number?

  • Profile Image
    DDorrell
    Asked on August 11, 2017 at 02:27 PM

    We have a form that calculates a number of free chaperones based on the number of students attending the event. One chaperone free for every 10 students paid. I want a field to show the number of free chaperones but rounded to the nearest whole number, by student increments of 10. So if there are 22 students attending, the result would be 2 chaperones. Then if there are 26 students attending, there would still be 2 chaperones. Right now I can get the field calculation to round, but after .5 it rounds up - not what I need.

  • Profile Image
    Kiran
    Answered on August 11, 2017 at 02:46 PM

    I understand that you want to calculate the 'Free Chaperones Included' to round down based on the number of students count. 

    You may consider adding the function floor() to the calculation in the widget so that it should be working correctly. Please see the screenshot below:

    You may get the floor() function by clicking on ... icon. 

    If you want to round up the value, you may use ceil() function.

    Hope this information helps! 

  • Profile Image
    DDorrell
    Answered on August 11, 2017 at 03:43 PM
    That was exactly what I needed! Thank you!
    ...