<PackageReference Include="System.Data.SqlClient" Version="4.7.0-preview.19073.11" />

SqlDecimal

public struct SqlDecimal : INullable, IComparable
Represents a numeric value between - 10^38 +1 and 10^38 - 1, with fixed precision and scale.
public static readonly byte MaxPrecision

A constant representing the largest possible value for the Precision property.

public static readonly byte MaxScale

A constant representing the maximum value for the Scale property.

public static readonly SqlDecimal MaxValue

A constant representing the maximum value of a SqlDecimal structure.

public static readonly SqlDecimal MinValue

A constant representing the minimum value for a SqlDecimal structure.

public static readonly SqlDecimal Null

Represents a DBNull that can be assigned to this instance of the SqlDecimal class.

public byte[] BinData { get; }

Get the binary representation of the value of this SqlDecimal structure as an array of bytes.

public int[] Data { get; }

Gets the binary representation of this SqlDecimal structure as an array of integers.

public bool IsNull { get; }

Indicates whether this SqlDecimal structure is null.

public bool IsPositive { get; }

Indicates whether the Value of this SqlDecimal structure is greater than zero.

public byte Precision { get; }

Gets the maximum number of digits used to represent the Value property.

public byte Scale { get; }

Gets the number of decimal places to which Value is resolved.

public decimal Value { get; }

Gets the value of the SqlDecimal structure. This property is read-only.

public SqlDecimal(byte bPrecision, byte bScale, bool fPositive, int data1, int data2, int data3, int data4)

Initializes a new instance of the SqlDecimal structure using the supplied parameters.

public SqlDecimal(byte bPrecision, byte bScale, bool fPositive, int[] bits)

Initializes a new instance of the SqlDecimal structure using the supplied parameters.

public SqlDecimal(decimal value)

Initializes a new instance of the SqlDecimal structure using the supplied Decimal value.

public SqlDecimal(double dVal)

Initializes a new instance of the SqlDecimal structure using the supplied double parameter.

public SqlDecimal(int value)

Initializes a new instance of the SqlDecimal structure using the supplied integer value.

public SqlDecimal(long value)

Initializes a new instance of the SqlDecimal structure using the supplied long integer value.

public static SqlDecimal Abs(SqlDecimal n)

The Abs method gets the absolute value of the SqlDecimal parameter.

public static SqlDecimal Add(SqlDecimal x, SqlDecimal y)

Calculates the sum of the two SqlDecimal operators.

public static SqlDecimal AdjustScale(SqlDecimal n, int digits, bool fRound)

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.

public static SqlDecimal Ceiling(SqlDecimal n)

Returns the smallest whole number greater than or equal to the specified SqlDecimal structure.

public static SqlDecimal ConvertToPrecScale(SqlDecimal n, int precision, int scale)

Adjusts the value of the SqlDecimal operand to the indicated precision and scale.

public static SqlDecimal Divide(SqlDecimal x, SqlDecimal y)

The division operator calculates the results of dividing the first SqlDecimal operand by the second.

public static SqlBoolean Equals(SqlDecimal x, SqlDecimal y)

Performs a logical comparison of the two SqlDecimal operands to determine whether they are equal.

public static SqlDecimal Floor(SqlDecimal n)

Rounds a specified SqlDecimal number to the next lower whole number.

Performs a logical comparison of two SqlDecimal structures to determine whether the first is greater than the second.

Performs a logical comparison of the two SqlDecimal parameters to determine whether the first is greater than or equal to the second.

Performs a logical comparison of two SqlDecimal structures to determine whether the first is less than the second.

Performs a logical comparison of the two SqlDecimal parameters to determine whether the first is less than or equal to the second.

The multiplication operator computes the product of the two SqlDecimal parameters.

Performs a logical comparison of the two SqlDecimal parameters to determine whether they are not equal.

Calculates the sum of the two SqlDecimal operators.

The division operator calculates the results of dividing the first SqlDecimal operand by the second.

Performs a logical comparison of the two SqlDecimal operands to determine whether they are equal.

Converts the supplied SqlBoolean structure to SqlDecimal.

public static decimal op_Explicit(SqlDecimal x)

Converts the SqlDecimal parameter to Decimal.

public static SqlDecimal op_Explicit(SqlDouble x)

Converts the supplied SqlDouble structure to SqlDecimal.

public static SqlDecimal op_Explicit(SqlSingle x)

Converts the supplied SqlSingle structure to SqlDecimal.

public static SqlDecimal op_Explicit(SqlString x)

Converts the supplied SqlString parameter to SqlDecimal.

public static SqlDecimal op_Explicit(double x)

Converts the Double parameter to SqlDecimal.

Performs a logical comparison of two SqlDecimal structures to determine whether the first is greater than the second.

Performs a logical comparison of the two SqlDecimal parameters to determine whether the first is greater than or equal to the second.

public static SqlDecimal op_Implicit(SqlByte x)

Converts the supplied SqlByte structure to SqlDecimal.

public static SqlDecimal op_Implicit(SqlInt16 x)

Converts the supplied SqlInt16 structure to SqlDecimal

public static SqlDecimal op_Implicit(SqlInt32 x)

Converts the supplied SqlInt32 structure to SqlDecimal.

public static SqlDecimal op_Implicit(SqlInt64 x)

Converts the supplied SqlInt64 structure to SqlDecimal.

public static SqlDecimal op_Implicit(SqlMoney x)

Converts the SqlMoney operand to SqlDecimal.

public static SqlDecimal op_Implicit(decimal x)

Converts the Decimal value to SqlDecimal.

public static SqlDecimal op_Implicit(long x)

Converts the supplied Int64 structure to SqlDecimal.

Performs a logical comparison of the two SqlDecimal parameters to determine whether they are not equal.

Performs a logical comparison of two SqlDecimal structures to determine whether the first is less than the second.

Performs a logical comparison of the two SqlDecimal parameters to determine whether the first is less than or equal to the second.

The multiplication operator computes the product of the two SqlDecimal parameters.

Calculates the results of subtracting the second SqlDecimal operand from the first.

The unary minus operator negates the SqlDecimal parameter.

public static SqlDecimal Parse(string s)

Converts the String representation of a number to its SqlDecimal equivalent.

public static SqlDecimal Power(SqlDecimal n, double exp)

Raises the value of the specified SqlDecimal structure to the specified exponential power.

public static SqlDecimal Round(SqlDecimal n, int position)

Gets the number nearest the specified SqlDecimal structure&#39;s value with the specified precision.

public static SqlInt32 Sign(SqlDecimal n)

Gets a value that indicates the sign of a SqlDecimal structure&#39;s Value property.

Calculates the results of subtracting the second SqlDecimal operand from the first.

public static SqlDecimal Truncate(SqlDecimal n, int position)

Truncates the specified SqlDecimal structure&#39;s value to the that you want position.

public int CompareTo(SqlDecimal value)

Compares this SqlDecimal instance to the supplied SqlDecimal object and returns an indication of their relative values.

public int CompareTo(object value)

Compares this SqlDecimal instance to the supplied Object and returns an indication of their relative values.

public double ToDouble()

Returns the a double equal to the contents of the Value property of this instance.

Converts this SqlDecimal structure to SqlBoolean.

public SqlByte ToSqlByte()

Converts this SqlDecimal structure to SqlByte.

Converts this SqlDecimal structure to SqlDouble.

Converts this SqlDecimal structure to SqlInt16.

Converts this SqlDecimal structure to SqlInt32.

Converts this SqlDecimal structure to SqlInt64.

Converts this SqlDecimal structure to SqlMoney.

Converts this SqlDecimal structure to SqlSingle.

Converts this SqlDecimal structure to SqlString.