DbFunctions.Truncate Method

Definition

Overloads

Truncate(Nullable<Decimal>, Nullable<Int32>)

When used as part of a LINQ to Entities query, this method invokes the canonical Truncate EDM function to truncate the given value to the number of specified digits.

Truncate(Nullable<Double>, Nullable<Int32>)

When used as part of a LINQ to Entities query, this method invokes the canonical Truncate EDM function to truncate the given value to the number of specified digits.

Truncate(Nullable<Decimal>, Nullable<Int32>)

When used as part of a LINQ to Entities query, this method invokes the canonical Truncate EDM function to truncate the given value to the number of specified digits.

[System.Data.Entity.DbFunction("Edm", "Truncate")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="digits")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="value")]
public static Nullable<decimal> Truncate (Nullable<decimal> value, Nullable<int> digits);
static member Truncate : Nullable<decimal> * Nullable<int> -> Nullable<decimal>
Public Shared Function Truncate (value As Nullable(Of Decimal), digits As Nullable(Of Integer)) As Nullable(Of Decimal)

Parameters

value
Nullable<Decimal>

The value to truncate.

digits
Nullable<Int32>

The number of digits to preserve.

Returns

The truncated value.

Attributes

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query. This function is translated to a corresponding function in the database.

Applies to

Truncate(Nullable<Double>, Nullable<Int32>)

When used as part of a LINQ to Entities query, this method invokes the canonical Truncate EDM function to truncate the given value to the number of specified digits.

[System.Data.Entity.DbFunction("Edm", "Truncate")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="value")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="digits")]
public static Nullable<double> Truncate (Nullable<double> value, Nullable<int> digits);
static member Truncate : Nullable<double> * Nullable<int> -> Nullable<double>
Public Shared Function Truncate (value As Nullable(Of Double), digits As Nullable(Of Integer)) As Nullable(Of Double)

Parameters

value
Nullable<Double>

The value to truncate.

digits
Nullable<Int32>

The number of digits to preserve.

Returns

The truncated value.

Attributes

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query. This function is translated to a corresponding function in the database.

Applies to