问题

问题:输出小数位数与 Survey123 Connect for ArcGIS 中的输入小数位数不匹配

Last Published: May 11, 2022

描述

在 Survey123 Connect for ArcGIS 中,大多数计算返回的输出的小数位数会与具有最多小数位的输入相匹配。 例如,下方调查是基于以下公式的计算:Plant1 + Plant2 + Plant3 = 总面积。 输入数据包含 2 位、3 位和 1 位小数。 双输出将跟随具有最多小数位的输入来返回具有 3 个小数位的数值。

The output has three decimal places.

在某些计算中,输出小数位数与输入的小数位数不匹配。 下图显示输入数据具有 2 位、3 位和 1 位小数位,但是输入返回具有 15 个小数位的数值。

The output returns a number with fifteen decimal places.

原因

计算必须配置 round 函数,以根据指定的小数位数四舍五入输出。

解决方案或解决方法

执行以下步骤以四舍五入至所需的输出小数位数。

:
这些步骤适用于涉及小数数据类型的计算。
  1. 在 Survey123 Connect for ArcGIS 的 XLS表单中,导航至 calculation 列,然后输入以下公式:
    round(${field_A} + ${field_B} + ${field_C}, decimal place)

    下图显示了已在 XLS 表单中使用 round 函数对公式进行了配置,其小数位数设置为 2。

    The round formula configured.
     
  2. 保存 XLS 表单。 这将更新 Survey123 Connect for ArcGIS 桌面。
  3. 在 Survey123 Connect for ArcGIS 桌面中,填写必填字段。 下面的图像显示输出的小数位数与在 XLS 中配置的小数位数匹配,为 2 位小数。

    This is the survey configured with the round operation.

或者,执行以下步骤将输出四舍五入为不具有任何小数位的整数。
  1. 在 Survey123 Connect for ArcGIS 的 XLS表单中,导航至 calculation 列,然后输入以下公式:
    int(${field_A} + ${field_B} + ${field_C})

    下图显示了已在 XLS 表单中使用 int 函数对公式进行了配置。

    This is the int operation.
     
  2. 保存 XLS 表单。 这将更新 Survey123 Connect for ArcGIS 桌面。
  3. 在 Survey123 Connect for ArcGIS 桌面中,填写必填字段。 下图显示输出为整数,不具有任何小数位。

    This is the form configured with the int operation.

文章 ID:000020308

从 ArcGIS 专家处获得帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项

相关信息

发现关于本主题的更多内容