HOW TO

Verwenden von Berechnungen in Survey123, um das Aufrunden von Dezimalwerten zum Konvertieren in einen Integer zu erzwingen

Last Published: April 16, 2024

Zusammenfassung

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

The 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 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, 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.

Vorgehensweise

To round numbers and have consistent results, a calculation can be used to force rounding values up or down in both the 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.

Artikel-ID: 000027109

Benachrichtigungen erhalten und Lösungen für neue oder häufige Probleme finden

Unser neuer KI-Chatbot stellt zusammengefasste Antworten und Videolösungen für Sie bereit.

Esri Support App herunterladen

Zugehörige Informationen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln