SqlDecimal.AdjustScale(SqlDecimal, Int32, Boolean) SqlDecimal.AdjustScale(SqlDecimal, Int32, Boolean) SqlDecimal.AdjustScale(SqlDecimal, Int32, Boolean) SqlDecimal.AdjustScale(SqlDecimal, Int32, Boolean) Method

定义

SqlDecimal 操作数的小数位数调整为位数参数指示的位数。The scale of the SqlDecimal operand will be adjusted to the number of digits indicated by the digits parameter. 取决于 fRound 参数的值,该值将舍入到适当的位数或者截断。Depending on the value of the fRound parameter, the value will either be rounded to the appropriate number of digits or truncated.

public:
 static System::Data::SqlTypes::SqlDecimal AdjustScale(System::Data::SqlTypes::SqlDecimal n, int digits, bool fRound);
public static System.Data.SqlTypes.SqlDecimal AdjustScale (System.Data.SqlTypes.SqlDecimal n, int digits, bool fRound);
static member AdjustScale : System.Data.SqlTypes.SqlDecimal * int * bool -> System.Data.SqlTypes.SqlDecimal
Public Shared Function AdjustScale (n As SqlDecimal, digits As Integer, fRound As Boolean) As SqlDecimal

参数

n
SqlDecimal SqlDecimal SqlDecimal SqlDecimal

要调整的 SqlDecimal 结构。The SqlDecimal structure to be adjusted.

digits
Int32 Int32 Int32 Int32

已调整的结构的位数。The number of digits in the adjusted structure.

fRound
Boolean Boolean Boolean Boolean

如果此参数是 true,将舍入新值,如果为 false,将截断该值。If this parameter is true, the new Value will be rounded, if false, the value will be truncated.

返回

一个新的 SqlDecimal 结构,它的 Value 属性包含调整后的数字。A new SqlDecimal structure whose Value property contains the adjusted number.

适用于

另请参阅