PowerApps 中的 Round、RoundDown 和 RoundUp 函数Round, RoundDown, and RoundUp functions in PowerApps

舍入数值。Rounds a number.

说明Description

RoundRoundDownRoundUp 函数可将数值舍入到指定的小数位数:The Round, RoundDown, and RoundUp functions round a number to the specified number of decimal places:

  • 如果后一位数字等于或大于 5,Round 函数会向上舍入,Round rounds up if the next digit is a 5 or higher. 否则向下舍入。Otherwise, this function rounds down.
  • RoundDown 函数始终向下舍入到前一个较小的数值。RoundDown always rounds down to the previous lower number.
  • RoundUp 函数始终向上舍入到下一个较大的数值。RoundUp always rounds up to the next higher number.

如果传递单个数值,则返回值为这个数值的舍入版本。If you pass a single number, the return value is the rounded version of that number. 如果传递包含数值的单列,则返回值为舍入数值的单列表。If you pass a single-column table that contains numbers, the return value is a single-column table of rounded numbers. 如果你有多列表,可以将其调整为单列表,如使用表中所述。If you have a multi-column table, you can shape it into a single-column table, as working with tables describes.

语法Syntax

Round( Number, DecimalPlaces )Round( Number, DecimalPlaces )
RoundDown( Number, DecimalPlaces )RoundDown( Number, DecimalPlaces )
RoundUp( Number, DecimalPlaces )RoundUp( Number, DecimalPlaces )

  • Number - 必需。Number - Required. 要舍入的数值。The number to round.
  • DecimalPlaces - 必需。DecimalPlaces - Required. 要舍入的小数点右边的位数。The number of places to the right of the decimal point to round to. 使用 0 表示舍入为整数。Use 0 to round to a whole number.