MS Access Round() 函数

定义和用法

Round() 函数将数字四舍五入到指定的小数位数。

注意:如果表达式以 5 结尾,此函数会进行四舍五入,以使最后一位数字为偶数。以下是一些示例:

  • Round(34.55, 1) - 结果:34.6(四舍五入)
  • Round(34.65, 1) - 结果:34.6(向下取整)

实例

在“产品”表中将“价格”列四舍五入到 1 位小数:

SELECT ProductName, Price, Round(Price, 1) AS RoundedPrice
FROM Products;

亲自试一试

语法

Round(expression, decimal_places)

参数

参数 描述
expression 必需。要四舍五入的数字表达式。
decimal_places

可选。要将表达式四舍五入到的小数位数。

如果省略,该函数会将数字四舍五入到最接近的整数。

技术细节

适用于: 从 Access 2000 开始