EdmFunctions.Truncate(DbExpression, DbExpression) 方法
定义
创建一个 DbFunctionExpression,它使用指定的参数(这些参数必须具有单精度、双精度或小数和整数结果类型)调用规范“Truncate”函数。Creates a DbFunctionExpression that invokes the canonical 'Truncate' function with the specified arguments, which must have a single, double or decimal, and integer result types. 表达式的结果类型与 value 的结果类型相同。The result type of the expression is the same as the result type of value.
public:
[System::Runtime::CompilerServices::Extension]
static System::Data::Common::CommandTrees::DbFunctionExpression ^ Truncate(System::Data::Common::CommandTrees::DbExpression ^ value, System::Data::Common::CommandTrees::DbExpression ^ digits);
public static System.Data.Common.CommandTrees.DbFunctionExpression Truncate (this System.Data.Common.CommandTrees.DbExpression value, System.Data.Common.CommandTrees.DbExpression digits);
static member Truncate : System.Data.Common.CommandTrees.DbExpression * System.Data.Common.CommandTrees.DbExpression -> System.Data.Common.CommandTrees.DbFunctionExpression
<Extension()>
Public Function Truncate (value As DbExpression, digits As DbExpression) As DbFunctionExpression
参数
- value
- DbExpression
一个表达式,指定要截断的数值。An expression that specifies the numeric value to truncate.
- digits
- DbExpression
一个表达式,指定要在截断时使用的精度位数。An expression that specifies the number of digits of precision to use when truncating.
返回
一个新的 DbFunctionExpression,它将指定的参数截断为最接近的整数值,并按 数字 的指定精度。A new DbFunctionExpression that truncates the specified argument to the nearest integer value, with precision as specified by digits.
例外
value digits value digits
value digits value digits