HOW TO

Use calculations in Survey123 to force rounding up decimal values to convert to an integer

Last Published: April 16, 2024

Summary

In ArcGIS Survey123, if values from a decimal question or field are passed to an integer question, depending on where the form is filled out, different results may occur.

The ArcGIS Survey123 field app rounds the values to the closest whole integer, for example, 1.2 is rounded down to 1, and 1.7 is rounded up to 2. However, in the ArcGIS Survey123 web app, the decimals are dropped instead of rounding to the closest whole integer, so  both 1.2 and 1.7 are rounded up to 1. This is a known issue and a defect has been logged against this behavior.

Additionally, when using a rounding function in a calculation, ArcGIS Survey123 always rounds to the closest whole integer, and it cannot be specified whether to round up or down. However, in some cases it may be necessary to force rounding of decimal values up and/or down.

Procedure

To round numbers and have consistent results, a calculation can be used to force rounding values up or down in both the ArcGIS Survey123 field app and the web app. 

The following calculation can be used to round values up, for example, both 1.2 and 1.7 are rounded to 2:

if(round(${decimal},0)<${decimal}, round(${decimal},0)+1,round(${decimal},0)) 

To round values down, use the following calculation, in this case, both 1.2 and 1.7 are rounded to 1:

if(round(${decimal1},0)>${decimal1}, round(${decimal1},0)-1,round(${decimal1},0))

A sample XLS form is attached to this article:  Calculation to Round up_Down.zip

Note:
There is an enhancement request to add this capability to Survey123 Connect.

Article ID: 000027109

Software:
  • ArcGIS Survey123

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options