DbFunctions.Truncate Method

 

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.

Namespace:   System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticTruncate(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_CAPS_pubmethodSystem_CAPS_staticTruncate(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.


DbFunctions.Truncate Method (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.

[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", 
	MessageId = "digits")]
[DbFunctionAttribute("Edm", "Truncate")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", 
	MessageId = "value")]
public static Nullable<decimal> Truncate(
	Nullable<decimal> value,
	Nullable<int> digits
)

Parameters

value
Type: System.Nullable<Decimal>

The value to truncate.

digits
Type: System.Nullable<Int32>

The number of digits to preserve.

Return Value

Type: System.Nullable<Decimal>

The truncated value.

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.


DbFunctions.Truncate Method (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.

[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", 
	MessageId = "value")]
[DbFunctionAttribute("Edm", "Truncate")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", 
	MessageId = "digits")]
public static Nullable<double> Truncate(
	Nullable<double> value,
	Nullable<int> digits
)

Parameters

value
Type: System.Nullable<Double>

The value to truncate.

digits
Type: System.Nullable<Int32>

The number of digits to preserve.

Return Value

Type: System.Nullable<Double>

The truncated value.

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.