Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

傳回四捨五入至指定小數位數的數位。

語法

round ( expression [numdecimalplaces ] )

Round 函數語法具有下列自變數:

引數

描述

expression

必要。 正在四捨五入的數字表達式。

numdecimalplaces

選擇性。 數位指出四捨五入中包含小數點右邊的位數。 如果省略,函數會四捨五入至最接近的整數。

附註: 此 VBA函數會傳回通常稱為彙整四捨五入的函數。 因此,使用此函數之前請務必小心。 如需更可預測的結果,請使用 Excel VBA 中的工作表圓形函數。

查詢範例

Expression

結果​​

SELECT ProductSales.ProductID, Round (FinalPrice) AS Expr1 FROM ProductSales;

傳回 [產品標識符] 與四捨五入至最接近的數位 (,沒有小數) 。

SELECT ProductSales.ProductID, Round (FinalPrice,1) AS RoundedPrice FROM ProductSales;

傳回 [產品標識符],且 「FinalPrice」四捨五入至最接近的 1 個小數數位,並顯示在 RounderPrice 欄中。

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×