共用方式為


EdmFunctions.Truncate(DbExpression, DbExpression) 方法

定義

建立會使用指定引數叫用標準 'Truncate' 函式的 DbFunctionExpression,其中的引數必須具有單精度浮點數、雙精度浮點數或十進位,以及整數結果型別。 運算式的結果類型與實值的結果類型相同。

public static System.Data.Entity.Core.Common.CommandTrees.DbFunctionExpression Truncate(this System.Data.Entity.Core.Common.CommandTrees.DbExpression value, System.Data.Entity.Core.Common.CommandTrees.DbExpression digits);
static member Truncate : System.Data.Entity.Core.Common.CommandTrees.DbExpression * System.Data.Entity.Core.Common.CommandTrees.DbExpression -> System.Data.Entity.Core.Common.CommandTrees.DbFunctionExpression
<Extension()>
Public Function Truncate (value As DbExpression, digits As DbExpression) As DbFunctionExpression

參數

value
DbExpression

運算式,指定要截斷的數值。

digits
DbExpression

運算式,指定截斷時要使用的精確位數。

傳回

新的 DbFunctionExpression,會將指定的引數截斷為最接近的整數值,有效位數如數位所指定。

適用於