SqlDecimal.AdjustScale(SqlDecimal, Int32, Boolean) Method

Definition

The scale of the SqlDecimal operand will be adjusted to the number of digits indicated by the digits parameter. Depending on the value of the fRound parameter, the value will either be rounded to the appropriate number of digits or truncated.

C#
public static System.Data.SqlTypes.SqlDecimal AdjustScale(System.Data.SqlTypes.SqlDecimal n, int digits, bool fRound);

Parameters

n
SqlDecimal

The SqlDecimal structure to be adjusted.

digits
Int32

The number of digits in the adjusted structure.

fRound
Boolean

If this parameter is true, the new Value will be rounded, if false, the value will be truncated.

Returns

A new SqlDecimal structure whose Value property contains the adjusted number.

Applies to

Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also