Rounding to the nearest whole integar

503
3
08-30-2021 11:14 AM
JohnnyHarley232
New Contributor III

I have a calculation inside of Survey123 for a particular question. My equation right now is:

if(contains(${sub_section}, '704.03.02', ${num_types} div '1000', "")). my field type is Integer on Survey123 

So if a user enters 2200 in this field and the calculation would technically return 2.2 if that value is divided by 1000. So the output of the formula is "2" since it is an integer field. .

Is it possible to include a RoundUp function to the next number so that anything over a whole number would increase by 1? if the value was 2.1 then round to 3.. if the value is 2.9 round to 3. 

Tags (2)
0 Kudos
3 Replies
DougBrowning
MVP Esteemed Contributor

This should do it.   int(${num_types} div 1000) + 1

0 Kudos
IsmaelChivite
Esri Notable Contributor

The round() function may work for you. For example: round(${aNumber},0) will round up a number to 0 decimal numbers and round(${aNumber},1) will round it to a number with 1 decimal

0 Kudos
PrachiPatel
New Contributor III

@JohnnyHarley232  It sure would be nice to have a RoundUp function. I have added it as an idea. Give it kudos if you think that would be helpful
https://community.esri.com/t5/arcgis-survey123-ideas/add-roundup-amp-rounddown-as-mathematical/idi-p...

0 Kudos