ExtendedNumerics mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 This type is safe for multithreaded operations. System.ValueType System.IComparable System.IComparable<System.Decimal> System.IConvertible System.IEquatable<System.Decimal> System.IFormattable System.Runtime.Serialization.IDeserializationCallback System.Runtime.InteropServices.ComVisible(true)

The value type represents decimal numbers ranging from positive 79,228,162,514,264,337,593,543,950,335 to negative 79,228,162,514,264,337,593,543,950,335. The value type is appropriate for financial calculations that require large numbers of significant integral and fractional digits and no round-off errors. The type does not eliminate the need for rounding. Rather, it minimizes errors due to rounding. For example, the following code produces a result of 0.9999999999999999999999999999 instead of 1.

code reference: System.Decimal.Class#1

When the result of the division and multiplication is passed to the method, the result suffers no loss of precision, as the following code shows.

code reference: System.Decimal.Class#2

A decimal number is a floating-point value that consists of a sign, a numeric value where each digit in the value ranges from 0 to 9, and a scaling factor that indicates the position of a floating decimal point that separates the integral and fractional parts of the numeric value.

The binary representation of a value consists of a 1-bit sign, a 96-bit integer number, and a scaling factor used to divide the 96-bit integer and specify what portion of it is a decimal fraction. The scaling factor is implicitly the number 10, raised to an exponent ranging from 0 to 28. Therefore, the binary representation of a value the form, ((-296 to 296) / 10(0 to 28)), where -(296-1) is equal to , and 296-1 is equal to . For more information about the binary representation of values and an example, see the constructor and the method.

The scaling factor also preserves any trailing zeros in a number. Trailing zeros do not affect the value of a number in arithmetic or comparison operations. However, trailing zeros might be revealed by the method if an appropriate format string is applied.

## Conversion Considerations

This type provides methods that convert values to and from , , , , , , , and values. Conversions from these integral types to are widening conversions that never lose information or throw exceptions.

Conversions from to any of the integral types are narrowing conversions that round the value to the nearest integer value toward zero. Some languages, such as C#, also support the conversion of values to values. If the result of these conversions cannot be represented in the destination type, an exception is thrown.

The type also provides methods that convert values to and from and values. Conversions from to or are narrowing conversions that might lose precision but not information about the magnitude of the converted value. The conversion does not throw an exception.

Conversions from or to throw an exception if the result of the conversion cannot be represented as a .

## Performing Operations on Decimal Values

The type supports standard mathematical operations such as addition, subtraction, division, multiplication, and unary negation. You can also work directly with the binary representation of a value by calling the method.

To compare two values, you can use the standard numeric comparison operators, or you can call the or method.

You can also call the members of the class to perform a wide range of numeric operations, including getting the absolute value of a number, determining the maximum or minimum value of two values, getting the sign of a number, and rounding a number.

Represents a decimal number.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  is one of the following:

  greater than

  less than

  equal to , but the Decimal representation does not support NaNs.

  equal to , but the Decimal representation does not support infinities.

  equal to , but the Decimal representation does not support infinities.

  This constructor rounds to 15 significant digits using rounding to nearest. This is done even if the number has more than 15 digits and the less significant digits are zero.

  Initializes a new instance of to the value of the specified double-precision floating-point number.

  The value to represent as a .
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  This constructor initializes the new to the value specified by . The scale of the new is 0.

  Initializes a new instance of to the value of the specified 32-bit signed integer.

  The value to represent as a .
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  is a null reference.

  does not contain four elements.

  The following example demonstrates using the (Int32 []) constructor.

  using System; class ConstructDecimal { public static void Main() { int negativeBitValue = unchecked ((int)0x80000000); int [] parts0 = {0,0,0,0}; //Positive Zero. int [] parts1 = {1,0,0,0}; int [] parts2 = {0,1,0,0}; int [] parts3 = {0,0,1,0}; int [] parts4 = {0,0,0,negativeBitValue}; // Negative zero. int [] parts5 = {1,1,1,0}; int [] partsMaxValue = {-1,-1,-1,0}; int [] partsMinValue = {-1,-1,-1,negativeBitValue};

  decimal d = new Decimal(parts0); Console.WriteLine("{{0,0,0,0}} = {0}",d); d = new Decimal(parts1); Console.WriteLine("{{1,0,0,0}} = {0}",d); d = new Decimal(parts2); Console.WriteLine("{{0,1,0,0}} = {0}",d); d = new Decimal(parts3); Console.WriteLine("{{0,0,1,0}} = {0}",d); d = new Decimal(parts4); Console.WriteLine("{{0,0,0,{0}}} = {1}",parts4[3],d); d = new Decimal(parts5); Console.WriteLine("{{1,1,1,0}} = {0}",d); d = new Decimal(partsMaxValue ); Console.WriteLine("{{-1,-1,-1,0}} = {0}",d); d = new Decimal(partsMinValue); Console.WriteLine("{{-1,-1,-1,{0}}} = {1}",partsMinValue [3],d); } }

  The output is

  {0,0,0,0} = 0

  {1,0,0,0} = 1

  {0,1,0,0} = 4294967296

  {0,0,1,0} = 18446744073709551616

  {0,0,0,-2147483648} = 0

  {1,1,1,0} = 18446744078004518913

  {-1,-1,-1,0} = 79228162514264337593543950335

  {-1,-1,-1,-2147483648} = -79228162514264337593543950335

  The binary representation of a number consists of a 1-bit sign, a 96-bit integer number, and a scaling factor used to divide the integer number and specify what portion of it is a decimal fraction. The scaling factor is implicitly the number 10, raised to an exponent ranging from 0 to 28.

  is a four-element long array of 32-bit signed integers.

  [0], [1], and [2] contain the low, middle, and high 32 bits of the 96-bit integer number.

  [3] contains the scale factor and sign, and consists of following parts:

  Bits 0 to 15, the lower word, are unused and must be zero.

  Bits 16 to 23 must contain an exponent between 0 and 28, which indicates the power of 10 to divide the integer number.

  Bits 24 to 30 are unused and must be zero.

  Bit 31 contains the sign; 0 meaning positive, and 1 meaning negative.

  A numeric value might have several possible binary representations; all are equally valid and numerically equivalent. Note that the bit representation differentiates between negative and positive zero. These values are treated as being equal in all operations.

  Initializes a new instance of to a decimal value represented in binary and contained in a specified array.

  An array of 32-bit signed integers containing a representation of a decimal value.
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  This constructor initializes the new to the value specified by . The scale of the new is 0.

  Initializes a new instance of to the value of the specified 64-bit signed integer.

  The value to represent as a .
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  is one of the following:

  greater than

  less than

  equal to , but the Decimal representation does not support NaNs.

  equal to , but the Decimal representation does not support infinities.

  equal to , but the Decimal representation does not support infinities.

  This constructor rounds to 7 significant digits using rounding to nearest. This is done even if the number has more than 7 digits and the less significant digits are zero.

  Initializes a new instance of to the value of the specified single-precision floating-point number.

  The value to represent as a .
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)

  This member is not CLS-compliant. For a CLS-compliant alternative, use the () constructor.

  This constructor initializes the new to the value specified by . The scale of the new is 0.

  Initializes a new instance of to the value of the specified 32-bit unsigned integer.

  The value to represent as a .
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)

  This constructor initializes the new to the value specified by . The scale of the new is 0.

  This member is not CLS-compliant. For a CLS-compliant alternative, use the () constructor.

  Initializes a new instance of to the value of the specified 64-bit unsigned integer.

  The value to represent as a .
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  The binary representation of a number consists of a 1-bit sign, a 96-bit integer number, and a scaling factor used to divide the integer number and specify what portion of it is a decimal fraction. The scaling factor is implicitly the number 10 raised to an exponent ranging from 0 to 28.

  Initializes a new instance of from parameters specifying the instance's constituent parts.

  The low 32 bits of a 96-bit integer.
  The middle 32 bits of a 96-bit integer.
  The high 32 bits of a 96-bit integer.
  true to indicate a negative number; false to indicate a positive number.
  A power of 10 ranging from 0 to 28.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` The sum of and is less than or greater than .

  The following code sample illustrates the use of Add :

  code reference: Decimal Example#5

  Adds two specified values.

  The sum of and .

  The first value to add. The second value to add. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Decimal ``

  The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding toward positive infinity. In other words, if is positive, the presence of any fractional component causes to be rounded to the next highest integer. If is negative, the rounding operation causes any fractional component of to be discarded. The operation of this method differs from the method, which supports rounding toward negative infinity.

  Returns the smallest integral value that is greater than or equal to the specified decimal number.

  The smallest integral value that is greater than or equal to the parameter. Note that this method returns a instead of an integral type.

  A decimal number.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
  System.Int32 `` `` To be added.

  Compares two specified values.

  A signed number indicating the relative values of and .

  Return value

  Meaning

  Less than zero

  is less than .

  Zero

  and are equal.

  Greater than zero

  is greater than .

  The first value to compare. The second value to compare. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  This method implements the interface and performs slightly better than the method because it does not have to convert the parameter to an object.

  Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance.

  For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the parameter as an object, then generates a method to compare the values of the instance and the parameter representation.

  Consult your programming language's documentation to determine whether its compiler performs implicit widening conversions on numeric types.

  Compares this instance to a specified object and returns a comparison of their relative values.

  A signed number indicating the relative values of this instance and .

  Return value

  Meaning

  Less than zero

  This instance is less than .

  Zero

  This instance is equal to .

  Greater than zero

  This instance is greater than .

  The object to compare with this instance.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` is not a and is not a null reference.

  Any instance of , regardless of its value, is considered greater than null.

  Parameter must be null or an instance of ; otherwise, an exception is thrown.

  Compares this instance to a specified object and returns a comparison of their relative values.

  A signed number indicating the relative values of this instance and .

  Return value

  Meaning

  Less than zero

  This instance is less than .

  Zero

  This instance is equal to .

  Greater than zero

  This instance is greater than .

  -or-

  is null.

  The object to compare with this instance, or null. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` To be added. is zero. The result is greater than or less than .

  Divides two specified values.

  The result of dividing by .

  The dividend. The divisor. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  This method implements the interface, and performs slightly better than because it does not have to convert the parameter to an object.

  If has fewer bits (is narrower) than the instance type, some programming languages perform an implicit widening conversion that transforms the value of the parameter into a value with more bits.

  For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method to compare the instance and parameter representation.

  Consult your programming language's documentation to determine whether its compiler performs implicit widening conversions on numeric types.

  Returns a value indicating whether this instance and a specified object represent the same value.

  true if is equal to this instance; otherwise, false.

  An object to compare to this instance.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  This method overrides .

  Returns a value indicating whether this instance and a specified represent the same type and value.

  true if is a and equal to this instance; otherwise, false.

  The object to compare with this instance. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` To be added.

  Returns a value indicating whether two specified instances of represent the same value.

  true if and are equal; otherwise, false.

  The first value to compare. The second value to compare. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal ``

  The following example demonstrates the method.

  `using System; class DecimalTest { public static void Main() { Console.WriteLine("floor {0} is {1}", 3.14159m, Decimal.Floor(3.14159m)); Console.WriteLine("floor {0} is {1}", -3.9m, Decimal.Floor(-3.9m)); Console.WriteLine("floor {0} is {1}", 3.0m, Decimal.Floor(3.0m)); } }`

  The output is

  floor 3.14159 is 3

  floor -3.9 is -4

  floor 3.0 is 3

  The behavior of this method follows IEEE Standard 754, Section 4. This kind of rounding is sometimes called rounding toward negative infinity. In other words, if is positive, any fractional component is truncated. If is negative, the presence of any fractional component causes it to be rounded to the smaller integer. The operation of this method differs from the method, which supports rounding toward positive infinity.

  Rounds a specified number to the closest integer toward negative infinity.

  If has a fractional part, the next whole number toward negative infinity that is less than .

  -or-

  If doesn't have a fractional part, is returned unchanged. Note that the method returns an integral value of type .

  The value to round. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` To be added.

  Converts the specified 64-bit signed integer, which contains an OLE Automation Currency value, to the equivalent value.

  A that contains the equivalent of .

  An OLE Automation Currency value.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32[] ``

  The following example demonstrates the different representations of 1.00 and 1.

  `using System; public class Class1 { public static void Print (int [] bs) { foreach (int b in bs) { Console.Write (b+" "); } } public static void Main () { decimal d = 1.00m; decimal d1 = 1; Console.Write (d); Console.Write (" - bits: "); Print (decimal.GetBits(d)); Console.WriteLine(); Console.Write (d1); Console.Write (" - bits: "); Print (decimal.GetBits(d1)); Console.WriteLine(); Console.WriteLine ("d1.CompareTo(d) == {0}", d1.CompareTo(d)); Console.WriteLine ("d1 == d {0}", d1 == d); } }`

  The binary representation of a number consists of a 1-bit sign, a 96-bit integer number, and a scaling factor used to divide the integer number and specify what portion of it is a decimal fraction. The scaling factor is implicitly the number 10, raised to an exponent ranging from 0 to 28.

  The return value is a four-element array of 32-bit signed integers.

  The first, second, and third elements of the returned array contain the low, middle, and high 32 bits of the 96-bit integer number.

  The fourth element of the returned array contains the scale factor and sign. It consists of the following parts:

  Bits 0 to 15, the lower word, are unused and must be zero.

  Bits 16 to 23 must contain an exponent between 0 and 28, which indicates the power of 10 to divide the integer number.

  Bits 24 to 30 are unused and must be zero.

  Bit 31 contains the sign: 0 mean positive, and 1 means negative.

  Note that the bit representation differentiates between negative and positive zero. These values are treated as being equal in all operations.

  Converts the value of a specified instance of to its equivalent binary representation.

  A 32-bit signed integer array with four elements that contain the binary representation of .

  The value to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32

  The algorithm used to generate the hash code value is unspecified.

  This method overrides .

  Returns the hash code for this instance.

  A 32-bit signed integer hash code.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.TypeCode To be added.

  Returns the for value type .

  The enumerated constant .

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal 79228162514264337593543950335

  The value of this constant is positive 79,228,162,514,264,337,593,543,950,335.

  Represents the largest possible value of . This field is constant and read-only.

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal -1

  The value of this constant is -1. The scale shall be 0.

  This field is read-only.

  Represents the number negative one (-1).

  0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal -79228162514264337593543950335

  The value of this constant is negative 79,228,162,514,264,337,593,543,950,335.

  Represents the smallest possible value of . This field is constant and read-only.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` To be added. The result is greater than or less than .

  Multiplies two specified values.

  The result of multiplying and .

  The multiplicand. The multiplier. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` To be added.

  Returns the result of multiplying the specified value by negative one.

  A decimal number with the value of , but the opposite sign.

  -or-

  Zero, if is zero.

  The value to negate. 0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal 1

  The value of this constant is 1. The scale shall be 0.

  This field is read-only.

  Represents the number one (1).

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` The sum of and is greater than or less than .

  The method defines the operation of the addition operator for values. It enables code such as the following:

  code reference: System.Decimal.Operators#3

  If the language you're using doesn't support custom operators, call the method instead.

  Adds two specified values.

  The result of adding and .

  The first value to add. The second value to add. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` The result is greater than or less than .

  The method defines the operation of the decrement operator for values. It enables code such as the following:

  code reference: System.Decimal.Operators#4

  Some languages (such as Visual Basic) that lack an increment operator can call the method directly, as the following example shows.

  code reference: System.Decimal.Operators#5

  If your language does not support custom operators, call the method instead, as the following example shows.

  code reference: System.Decimal.Operators#6

  Decrements the operand by one.

  The value of decremented by 1.

  The value to decrement. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` The divisor is zero. The result is greater than or less than .

  The method defines the operation of the division operator for values. It enables code such as the following:

  code reference: System.Decimal.Operators#7

  If the language you're using doesn't support custom operators, call the method instead.

  Divides two specified values.

  The result of dividing by .

  The dividend. The divisor. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the equality operator for values. It enables code such as the following:

  code reference: System.Decimal.Operators#1

  If the language you're using doesn't support custom operators, call the method instead.

  Returns a value that indicates whether two values are equal.

  true if and are equal; otherwise, false.

  The first value to compare. The second value to compare. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte `` The value to convert to .

  Perform an explicit conversion of a value to .

  A with the specified value.

  This operation can produce round-off errors due to the fact that has fewer significant digits than, and has a different radix than, .

  The resulting integer value is greater than or less than . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` The value to convert to .

  Perform an explicit conversion of a value to .

  A containing rounded towards zero to the nearest integer.

  To be added. The resulting integer value is greater than or less than . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double `` The value to convert to .

  Perform an explicit conversion of a value to .

  A with the specified value.

  This operation can produce round-off errors due to the fact that has fewer significant digits than .

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 `` The value to convert to .

  Perform an explicit conversion of a value to .

  A containing rounded towards zero to the nearest integer.

  To be added. The resulting integer value is greater than or less than . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` The value to convert to .

  Perform an explicit conversion of a value to .

  A containing rounded towards zero to the nearest integer.

  To be added. The resulting integer value is greater than or less than . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` The value to convert to .

  Perform an explicit conversion of a value to .

  A containing rounded towards zero to the nearest integer.

  To be added. The resulting integer value is greater than or less than . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte `` The value to convert to .

  Perform an explicit conversion of a value to .

  A containing rounded towards zero to the nearest integer.

  This member is not CLS-compliant. For a CLS-compliant alternative to , use .

  The resulting integer value is greater than or less than . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` The value to convert to .

  Perform an explicit conversion of a value to .

  A containing rounded towards zero to the nearest integer.

  This member is not CLS-compliant. For a CLS-compliant alternative to , use .

  The resulting integer value is greater than or less than . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 `` The value to convert to .

  Perform an explicit conversion of a value to .

  A containing rounded towards zero to the nearest integer.

  This member is not CLS-compliant. For a CLS-compliant alternative to , use .

  The resulting integer value is greater than or less than . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 `` The value to convert to .

  Perform an explicit conversion of a value to .

  A containing rounded towards zero to the nearest integer.

  This member is not CLS-compliant. For a CLS-compliant alternative to , use ).

  The resulting integer value is greater than or less than . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 `` The value to convert to .

  Perform an explicit conversion of a value to .

  A containing rounded towards zero to the nearest integer.

  This member is not CLS-compliant. For a CLS-compliant alternative to , use .

  The resulting integer value is greater than or less than . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` The value to convert to .

  Perform an explicit conversion of a value to .

  A with the specified value.

  To be added.

  is one of the following:

  greater than

  less than

  equal to , but the Decimal representation does not support NaNs.

  equal to , but the Decimal representation does not support infinities.

  equal to , but the Decimal representation does not support infinities.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` The value to convert to .

  Perform an explicit conversion of a value to .

  A with the specified value.

  To be added.

  is one of the following:

  greater than

  less than

  equal to , but the Decimal representation does not support NaNs.

  equal to , but the Decimal representation does not support infinities.

  equal to , but the Decimal representation does not support infinities.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the greater than operator for values. It enables code such as the following:

  code reference: System.Decimal.Operators#8

  Languages that do not support custom operators can call the method instead. They may also be able to call the method directly, as the following example shows.

  code reference: System.Decimal.Operators#9

  Returns a value indicating whether a specified is greater than another specified .

  true if is greater than ; otherwise, false.

  The first value to compare. The second value to compare. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the greater than or equal operator for values. It enables code such as the following:

  code reference: System.Decimal.Operators#10

  Languages that do not support custom operators can call the method instead. They may also be able to call the method directly, as the following example shows.

  code reference: System.Decimal.Operators#11

  Returns a value indicating whether a specified is greater than or equal to another specified .

  true if is greater than or equal to ; otherwise, false.

  The first value to compare. The second value to compare. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` The value to convert to .

  Perform an implicit conversion of a value to .

  A with the specified value.

  To be added. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` The value to convert to .

  Perform an implicit conversion of a value to .

  A with the specified value.

  To be added. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` The value to convert to .

  Perform an implicit conversion of a value to .

  A with the specified value.

  To be added. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` The value to convert to .

  Perform an implicit conversion of a value to .

  A with the specified value.

  To be added. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` The value to convert to .

  Perform an implicit conversion of a value to .

  A with the specified value.

  To be added. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Decimal `` The value to convert to .

  Perform an implicit conversion of a value to .

  A with the specified value.

  This member is not CLS-compliant.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Decimal `` The value to convert to .

  Perform an implicit conversion of a value to .

  A with the specified value.

  This member is not CLS-compliant.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Decimal `` The value to convert to .

  Perform an implicit conversion of a value to .

  A with the specified value.

  This member is not CLS-compliant.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Decimal `` The value to convert to .

  Perform an implicit conversion of a value to .

  A with the specified value.

  This member is not CLS-compliant.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` The result is greater than or less than .

  The method defines the operation of the increment operator for values. It enables code such as the following:

  code reference: System.Decimal.Operators#12

  Some languages (such as Visual Basic) that lack an increment operator can call the method directly, as the following example shows.

  code reference: System.Decimal.Operators#13

  If your language does not support custom operators, call the method instead, as the following example shows.

  code reference: System.Decimal.Operators#14

  Increments the operand by 1.

  The value of incremented by 1.

  The value to increment. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the inequality operator for values. It enables code such as the following:

  code reference: System.Decimal.Operators#2

  If the language you're using doesn't support custom operators, you can test for inequality by using one of the following techniques:

  Calling the method, which indicates the relationship between two values.

  Calling the method and reversing its value.

  Returns a value that indicates whether two objects have different values.

  true if and are not equal; otherwise, false.

  The first value to compare. The second value to compare. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the less than operator for values. It enables code such as the following:

  code reference: System.Decimal.Operators#15

  Languages that do not support custom operators can call the method instead. They may also be able to call the method directly, as the following example shows.

  code reference: System.Decimal.Operators#16

  Returns a value indicating whether a specified is less than another specified .

  true if is less than ; otherwise, false.

  The first value to compare. The second value to compare. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the less than or equal operator for values. It enables code such as the following:

  code reference: System.Decimal.Operators#17

  Languages that do not support custom operators can call the method instead. They may also be able to call the method directly, as the following example shows.

  code reference: System.Decimal.Operators#18

  Returns a value indicating whether a specified is less than or equal to another specified .

  true if is less than or equal to ; otherwise, false.

  The first value to compare. The second value to compare. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` is zero. divided by is greater than or less than .

  The method defines the operation of the modulus operator for values. It enables code such as the following:

  code reference: System.Decimal.Operators#19

  If the language you're using doesn't support custom operators, call the method instead.

  The sign of the value return by the modulus operation depends on the sign of dividend. If dividend is positive, the modulus operation returns a positive result; if it is negative, the modulus operation returns a negative result.

  Returns the remainder resulting from dividing two specified values.

  The remainder resulting from dividing by .

  The dividend. The divisor. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` The result is greater than or less than .

  The method defines the operation of the multiplication operator for values. It enables code such as the following:

  code reference: System.Decimal.Operators#20

  If the language you're using doesn't support custom operators, call the method instead.

  Multiplies two specified values.

  The result of multiplying by .

  The first value to multiply. The second value to multiply. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` The result is greater than or less than .

  The method defines the operation of the subtraction operator for values. It enables code such as the following:

  code reference: System.Decimal.Operators#21

  If the language you're using doesn't support custom operators, call the method instead.

  Subtracts two specified values.

  The result of subtracting from .

  The minuend. The subtrahend. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal ``

  The method defines the operation of the unary negation operator (or the additive inverse operator) for values. The operation produces a value that results in 0 (zero) when it is added to the original number. Languages that do not support custom operators can call the method instead.

  Negates the value of the specified operand.

  The result of multiplied by negative one (-1).

  The value to negate. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal ``

  The method defines the operation of the unary positive operator for values.

  Returns the value of the operand (the sign of the operand is unchanged).

  The value of the operand, .

  The operand to return. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` is a null reference. is not in the correct format. represents a number greater than or less than .

  The following example demonstrates the method.

  `using System; using System.Globalization; class DecimalParseClass { public static void Main() { string s1 = " -1.001 "; string s2 = "+1,000,111.99"; string s3 = "2.900"; Console.WriteLine("String: {0} (decimal) {1}",s1,Decimal.Parse(s1)); Console.WriteLine("String: {0} (decimal) {1}",s2,Decimal.Parse(s2)); Console.WriteLine("String: {0} (decimal) {1}",s3,Decimal.Parse(s3)); } }`

  The output is

  String: -1.001 (decimal) -1.001

  String: +1,000,111.99 (decimal) 1000111.99

  String: 2.900 (decimal) 2.900

  Parameter contains a number of the form:

  [ws][sign][digits,]digits[.fractional-digits][ws]

  Elements in square brackets ([ and ]) are optional. The following table describes each element.

  Element

  Description

  ws

  Optional white space.

  sign

  An optional sign.

  digits

  A sequence of digits ranging from 0 to 9.

  ,

  A culture-specific thousands separator symbol.

  .

  A culture-specific decimal point symbol.

  fractional-digits

  A sequence of digits ranging from 0 to 9.

  Parameter is interpreted using the style. This means that white space and thousands separators are allowed but currency symbols are not. To explicitly define the elements (such as currency symbols, thousands separators, and white space) that can be present in , use either the or the method.

  Parameter is parsed using the formatting information in a initialized for the current system culture. For more information, see . To parse a string using the formatting information of some other culture, use the or method.

  If necessary, the value of is rounded using rounding to nearest.

  A has 29 digits of precision. If represents a number that has more than 29 digits, but has a fractional part and is within the range of and , the number is rounded, not truncated, to 29 digits using rounding to nearest.

  If during a parse operation a separator is encountered in the parameter, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and .

  Converts the string representation of a number to its equivalent.

  The equivalent to the number contained in .

  The string representation of the number to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` is a null reference. is not in the correct style. represents a number greater than or less than .

  The following example demonstrates supplying values to the method to allow for a symbol separating groups of digits, and a decimal separator. This example uses the symbols from the U.S. English culture, namely a comma and a decimal point.

  `using System; using System.Globalization; class DecimalParseClass { public static void Main() { string s = "1,000,111.99"; NumberStyles ns = NumberStyles.AllowThousands | NumberStyles.AllowDecimalPoint; decimal d = Decimal.Parse(s,ns); Console.WriteLine("{0} parsed to decimal {1}",s,d); } }`

  The output is

  1,000,111.99 parsed to decimal 1000111.99

  The parameter defines the style elements (such as thousands separators, white space, and currency symbols) that are allowed in the parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. The following members are not supported:

  Depending on the value of , the parameter may include the following elements:

  [ws][$][sign][digits,]digits[.fractional-digits][e[sign]digits][ws]

  Elements in square brackets ([ and ]) are optional. The following table describes each element.

  Element

  Description

  ws

  Optional white space. White space can appear at the beginning of if includes the flag, and it can appear at the end of if includes the flag.

  $

  A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in if includes the flag.

  sign

  An optional sign. The sign can appear at the beginning of if includes the flag, and it can appear at the end of if includes the flag. Parentheses can be used in to indicate a negative value if includes the flag.

  digits

  A sequence of digits ranging from 0 to 9.

  ,

  A culture-specific thousands separator symbol. The current culture's thousands separator can appear in if includes the flag.

  .

  A culture-specific decimal point symbol. The current culture's decimal point symbol can appear in if includes the flag.

  fractional-digits

  A sequence of digits ranging from 0 to 9. Fractional digits can appear in only if includes the flag.

  e

  The 'e' or 'E' character, which indicates that the value is represented in exponential notation. The parameter can represent a number in exponential notation if includes the flag.

  A string with digits only (which corresponds to the style) always parses successfully. The remaining members control elements that may be but are not required to be present in the input string. The following table indicates how individual members affect the elements that may be present in .

  NumberStyles value

  Elements permitted in s in addition to digits

  The digits element only.

  The . and fractional-digits elements.

  The parameter can also use exponential notation. This flag supports values in the form digitsEdigits; additional flags are needed to successfully parse strings with elements such as positive or negative signs and decimal point symbols.

  The ws element at the beginning of .

  The ws element at the end of .

  The sign element at the beginning of .

  The sign element at the end of .

  The sign element in the form of parentheses enclosing the numeric value.

  The , element.

  The $ element.

  All. The parameter cannot represent a hexadecimal number or a number in exponential notation.

  The ws element at the beginning or end of , sign at the beginning of , and the . symbol. The parameter can also use exponential notation.

  The , , ,, and . elements.

  All styles, except cannot represent a hexadecimal number.

  The parameter is parsed using the formatting information in a object initialized for the current system culture. For more information, see .

  A has 29 digits of precision. If represents a number that has more than 29 digits, but has a fractional part and is within the range of and , the number is rounded, not truncated, to 29 digits using rounding to nearest.

  If a separator is encountered in the parameter during a parse operation, includes the and values, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and .

  Converts the string representation of a number in a specified style to its equivalent.

  The number equivalent to the number contained in as specified by .

  The string representation of the number to convert. A bitwise combination of values that indicates the style elements that can be present in . A typical value to specify is . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` is not in the correct style. represents a number greater than or less than . is a null reference.

  The following example demonstrates supplying a to the method to allow a decimal point, and commas separating groups of digits.

  `using System; using System.Globalization; class DecimalParseClass { public static void Main() { string s = "1,000,111.99"; //Get the default formatting symbols. NumberFormatInfo nfi = new NumberFormatInfo(); // Default group separator is ',' // Default decimal separator is '.' decimal d = Decimal.Parse(s,nfi); Console.WriteLine("{0} parsed to decimal {1}",s,d); } }`

  The output is

  1,000,111.99 parsed to decimal 1000111.99

  This overload of the method is commonly used to convert text that can be formatted in a variety of ways to a value. For example, it can be used to convert the text entered by a user into an HTML text box to a numeric value.

  The parameter contains a number of the form:

  [ws][sign][digits,]digits[.fractional-digits][ws]

  Elements in square brackets ([ and ]) are optional. The following table describes each element.

  Element

  Description

  ws

  Optional white space.

  sign

  An optional sign.

  digits

  A sequence of digits ranging from 0 to 9.

  ,

  A culture-specific thousands separator symbol.

  .

  A culture-specific decimal point symbol.

  fractional-digits

  A sequence of digits ranging from 0 to 9.

  The parameter is interpreted using the style. This means that white space and thousands separators are allowed but currency symbols are not. To explicitly define the elements (such as currency symbols, thousands separators, and white space) that can be present in , use the method.

  The parameter is an implementation, such as a or object. The parameter supplies culture-specific information used in parsing. If is null, the thread current culture is used.

  A object has 29 digits of precision. If represents a number that has more than 29 digits, but has a fractional part and is within the range of and , the number is rounded, not truncated, to 29 digits using rounding to nearest.

  If a separator is encountered in the parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and .

  Converts the string representation of a number to its equivalent using the specified culture-specific format information.

  The number equivalent to the number contained in as specified by .

  The string representation of the number to convert. An that supplies culture-specific parsing information about . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` ``

  is a null reference.

  is not in the correct style. represents a number greater than or less than .

  The following example demonstrates supplying values and a to the method to allow colons separating groups of digits, and a decimal point.

  `using System; using System.Globalization; class DecimalParseClass { public static void Main() { string s = "1:000:111.99"; NumberStyles ns = NumberStyles.AllowThousands | NumberStyles.AllowDecimalPoint; NumberFormatInfo nfi = new NumberFormatInfo(); //Change the format info to separate digit groups using a colon. nfi.NumberGroupSeparator = ":"; decimal d = Decimal.Parse(s,ns,nfi); Console.WriteLine("{0} parsed to decimal {1}",s,d); } }`

  The output is

  1:000:111.99 parsed to decimal 1000111.99

  The parameter defines the allowable format of the parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. The following members are not supported:

  Depending on the value of , the parameter may include the following elements:

  [ws][$][sign][digits,]digits[.fractional-digits][e[sign]digits][ws]

  Elements in square brackets ([ and ]) are optional. The following table describes each element.

  Element

  Description

  $

  A culture-specific currency symbol. Its position in the string is defined by the and properties of the object returned by the method of the parameter. The currency symbol can appear in if includes the flag.

  ws

  Optional white space. White space can appear at the beginning of if includes the flag, and it can appear at the end of if includes the flag.

  sign

  An optional sign. The sign can appear at the beginning of if includes the flag, and it can appear at the end of if includes the flag. Parentheses can be used in to indicate a negative value if includes the flag.

  digits

  A sequence of digits ranging from 0 to 9.

  ,

  A culture-specific thousands separator symbol. The thousands separator of the culture defined by can appear in if includes the flag.

  .

  A culture-specific decimal point symbol. The decimal point symbol of the culture defined by can appear in if includes the flag.

  fractional-digits

  A sequence of digits ranging from 0 to 9. Fractional digits can appear in only if includes the flag.

  e

  The 'e' or 'E' character, which indicates that the value is represented in exponential notation. The parameter can represent a number in exponential notation if includes the flag.

  A string with digits only (which corresponds to the style) always parses successfully. The remaining members control elements that may be but are not required to be present in the input string. The following table indicates how individual members affect the elements that may be present in .

  NumberStyles value

  Elements permitted in s in addition to digits

  The digits element only.

  The . and fractional-digits elements.

  The parameter can also use exponential notation. This flag supports values in the form digitsEdigits; additional flags are needed to successfully parse strings with elements such as positive or negative signs and decimal point symbols.

  The ws element at the beginning of .

  The ws element at the end of .

  The sign element at the beginning of .

  The sign element at the end of .

  The sign element in the form of parentheses enclosing the numeric value.

  The , element.

  The $ element.

  All. The parameter cannot represent a hexadecimal number or a number in exponential notation.

  The ws element at the beginning or end of , sign at the beginning of , and the .

  symbol. The parameter can also use exponential notation.

  The , , ,, and . elements.

  All styles, except cannot represent a hexadecimal number.

  The parameter is an implementation, such as a or object. The parameter supplies culture-specific information used in parsing. If is null, the thread current culture is used.

  A object has 29 digits of precision. If represents a number that has more than 29 digits, but has a fractional part and is within the range of and , the number is rounded, not truncated, to 29 digits using rounding to nearest.

  If a separator is encountered in the parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and .

  Converts the string representation of a number to its equivalent using the specified style and culture-specific format.

  The number equivalent to the number contained in as specified by and .

  The string representation of the number to convert. A bitwise combination of values that indicates the style elements that can be present in . A typical value to specify is . An object that supplies culture-specific information about the format of . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` To be added. is zero. divided by is greater than or less than . The divisor.

  Computes the remainder after dividing two values.

  The remainder after dividing by .

  The dividend. The divisor. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Decimal ``

  The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding to nearest or banker's rounding. It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction. It is equivalent to calling the method with a argument of .

  Rounds a decimal value to the nearest integer.

  The integer that is nearest to the parameter. If is halfway between two integers, one of which is even and the other odd, the even number is returned.

  A decimal number to round.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` is not between 0 and 28, inclusive.

  The following example demonstrates the method.

  `using System; class MyClass { public static void Main() { decimal d1 = 2.5m; decimal d2 = 3.5m; decimal d3 = 2.98765432m; decimal d4 = 2.18765432m; Console.WriteLine("Rounding to 0 places..."); Console.WriteLine("round {0} = {1}",d1, Decimal.Round(d1,0)); Console.WriteLine("round {0} = {1}",d2, Decimal.Round(d2,0)); Console.WriteLine("round {0} = {1}",d3, Decimal.Round(d3,0)); Console.WriteLine("round {0} = {1}",d4, Decimal.Round(d4,0)); Console.WriteLine("Rounding to 2 places..."); Console.WriteLine("round {0} = {1}",d1, Decimal.Round(d1,2)); Console.WriteLine("round {0} = {1}",d2, Decimal.Round(d2,2)); Console.WriteLine("round {0} = {1}",d3, Decimal.Round(d3,2)); Console.WriteLine("round {0} = {1}",d4, Decimal.Round(d4,2)); } }`

  The output is

  Rounding to 0 places...

  round 2.5 = 2

  round 3.5 = 4

  round 2.98765432 = 3

  round 2.18765432 = 2

  Rounding to 2 places...

  round 2.5 = 2.5

  round 3.5 = 3.5

  round 2.98765432 = 2.99

  round 2.18765432 = 2.19

  This method is equivalent to calling the method with a argument of .When is exactly halfway between two rounded values, the result is the rounded value that has an even digit in the far right decimal position. For example, when rounded to two decimals, the value 2.345 becomes 2.34 and the value 2.355 becomes 2.36. This process is known as rounding toward even, or rounding to nearest. It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.

  Rounds a value to a specified number of decimal places.

  The decimal number equivalent to rounded to number of decimal places.

  A decimal number to round. A value from 0 to 28 that specifies the number of decimal places to round to. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Decimal `` ``

  The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding to nearest or banker's rounding.

  Rounds a decimal value to the nearest integer. A parameter specifies how to round the value if it is midway between two other numbers.

  The integer that is nearest to the parameter. If is halfway between two numbers, one of which is even and the other odd, the parameter determines which of the two numbers is returned.

  A decimal number to round. A value that specifies how to round if it is midway between two other numbers.
- Method
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` ``

  The parameter specifies the number of significant decimal places in the return value and ranges from 0 to 28. If is zero, an integer is returned.

  The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding to nearest or banker's rounding. If is zero, this kind of rounding is sometimes called rounding toward zero.

  Rounds a decimal value to a specified precision. A parameter specifies how to round the value if it is midway between two other numbers.

  The number that is nearest to the parameter with a precision equal to the parameter. If is halfway between two numbers, one of which is even and the other odd, the parameter determines which of the two numbers is returned. If the precision of is less than , is returned unchanged.

  A decimal number to round. The number of significant decimal places (precision) in the return value. A value that specifies how to round if it is midway between two other numbers.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` To be added. The result is greater than or less than .

  Subtracts one specified value from another.

  The result of subtracting from .

  The minuend. The subtrahend. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  true if the value of the current instance is not zero; otherwise, false.

  This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call either the method or the method.

  For a description of this member, see .

  The value of the current instance, converted to a .

  This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` To be added.

  This conversion is not supported. Attempting to use this method throws an .

  None. This conversion is not supported.

  This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` To be added.

  This conversion is not supported. Attempting to use this method throws an .

  None. This conversion is not supported.

  This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  For a description of this member, see .

  The value of the current instance, unchanged.

  This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call either the method or the method.

  Because a has fewer significant digits than a , this operation may produce round-off errors.

  For a description of this member, see .

  The value of the current instance, converted to a .

  This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call either the method or the method.

  The value is rounded toward zero to the nearest integer value.

  For a description of this member, see .

  The value of the current instance, converted to a .

  This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call either the method or the method.

  The value is rounded toward zero to the nearest integer value.

  For a description of this member, see .

  The value of the current instance, converted to a .

  The parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call either the method or the method.

  For a description of this member, see .

  The value of the current instance, converted to a .

  This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.SByte ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call either the method or the method.

  For a description of this member, see .

  The value of the current instance, converted to a .

  This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call either the method or the method.

  For a description of this member, see .

  The value of the current instance, converted to a .

  This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object `` `` To be added.

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the static (Shared in Visual Basic) method instead.

  For a description of this member, see .

  The value of the current instance, converted to a .

  An implementation that supplies culture-specific information about the format of the returned value.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.UInt16 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call either the method or the method.

  For a description of this member, see .

  The value of the current instance, converted to a .

  This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.UInt32 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call either the method or the method.

  The value is rounded toward zero to the nearest integer value.

  For a description of this member, see .

  The value of the current instance, converted to a .

  This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.UInt64 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call either the method or the method.

  The value is rounded toward zero to the nearest integer value.

  For a description of this member, see .

  The value of the current instance, converted to a .

  This parameter is ignored.
- Method
  4.0.0.0
  System.Void `` To be added.

  Runs when the deserialization of an object has been completed.

  The object that initiated the callback. The functionality for this parameter is not currently implemented.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte ``

  Parameter is rounded to the nearest integer value toward zero, and that result is returned.

  Converts the value of the specified to the equivalent 8-bit unsigned integer.

  An 8-bit unsigned integer equivalent to .

  The decimal number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double ``

  This operation can produce round-off errors because a double-precision floating-point number has fewer significant digits than a .

  Converts the value of the specified to the equivalent double-precision floating-point number.

  A double-precision floating-point number equivalent to .

  The decimal number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 `` To be added.

  Converts the value of the specified to the equivalent 16-bit signed integer.

  A 16-bit signed integer equivalent to .

  The decimal number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  The return value is the integral part of the decimal value; fractional digits are truncated.

  Converts the value of the specified to the equivalent 32-bit signed integer.

  A 32-bit signed integer equivalent to the value of .

  The decimal number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 ``

  The return value is the integral part of the decimal value; fractional digits are truncated.

  Converts the value of the specified to the equivalent 64-bit signed integer.

  A 64-bit signed integer equivalent to the value of .

  The decimal number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` To be added.

  Converts the specified value to the equivalent OLE Automation Currency value, which is contained in a 64-bit signed integer.

  A 64-bit signed integer that contains the OLE Automation equivalent of .

  The decimal number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte `` To be added.

  Converts the value of the specified to the equivalent 8-bit signed integer.

  An 8-bit signed integer equivalent to .

  The decimal number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single ``

  This operation can produce round-off errors because a single-precision floating-point number has fewer significant digits than a .

  Converts the value of the specified to the equivalent single-precision floating-point number.

  A single-precision floating-point number equivalent to the value of .

  The decimal number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  The method formats a value in the default ("G", or general) format of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows:

  To use format

  For culture

  Use the overload

  Default ("G") format

  A specific culture

  A specific format

  Default (current) culture

  A specific format

  A specific culture

  The .NET Framework provides extensive formatting support, which is described in greater detail in the following formatting topics:

  For more information about numeric format specifiers, see Standard Numeric Format Strings and Custom Numeric Format Strings.

  For more information about formatting, see Formatting Types.

  Converts the numeric value of this instance to its equivalent string representation.

  A string that represents the value of this instance.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  The method formats a value in the default ("G", or general) format of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows:

  To use format

  For culture

  Use the overload

  Default ("G") format

  Default (current) culture

  A specific format

  Default (current) culture

  A specific format

  A specific culture

  The .NET Framework provides extensive formatting support, which is described in greater detail in the following formatting topics:

  For more information about numeric format specifiers, see Standard Numeric Format Strings and Custom Numeric Format Strings.

  For more information about formatting, see Formatting Types.

  The parameter is an implementation whose method returns a object. Typically, is a object or a object. The parameter supplies culture-specific information used in formatting. If is null, the thread current culture is used.

  To convert a value to its string representation using a specified culture and a specific format string, call the method.

  Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.

  The string representation of the value of this instance as specified by .

  An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` is invalid.

  The following example shows the effects of various formats on the string returned by .

  `using System; class test { public static void Main() { decimal d = 1234.56789m; Console.WriteLine(d); string[] fmts = {"C","E","F","G","N","P"}; for (int i=0;i<fmts.Length;i++) Console.WriteLine("{0}: {1}", fmts[i],d.ToString(fmts[i])); } }`

  The output is

  1234.56789

  C: $1,234.57

  E: 1.234568E+003

  F: 1234.57

  G: 1234.56789

  N: 1,234.57

  P: 123,456.79 %

  The method formats a value in a specified format by using the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows:

  To use format

  For culture

  Use the overload

  Default ("G") format

  Default (current) culture

  Default ("G") format

  A specific culture

  A specific format

  A specific culture

  The method uses the standard or custom numeric format string specified by the parameter to convert the value of the current instance into its string representation. The parameter can be any valid standard numeric format specifier except for D, R, and X, as well as any combination of custom numeric format specifiers. If is null or an empty string, the return value of this instance is formatted with the general numeric format specifier (G).

  The .NET Framework provides extensive formatting support, which is described in greater detail in the following formatting topics:

  For more information about numeric format specifiers, see Standard Numeric Format Strings and Custom Numeric Format Strings.

  For more information about formatting, see Formatting Types.

  The return value is formatted by using the object for the current culture. To apply the formatting conventions of a specified culture, call the method.

  Converts the numeric value of this instance to its equivalent string representation, using the specified format.

  The string representation of the value of this instance as specified by .

  A standard or custom numeric format string (see Remarks). 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` is invalid.

  The method formats a value in a specified format of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows:

  To use format

  For culture

  Use the overload

  Default ("G") format

  Default (current) culture

  Default ("G") format

  A specific culture

  A specific format

  Default (current) culture

  The parameter can be any valid standard numeric format specifier except for D, R, and X, as well as any combination of custom numeric format specifiers. If is null or an empty string, the return value for this instance is formatted with the general numeric format specifier ("G").

  The .NET Framework provides extensive formatting support, which is described in greater detail in the following formatting topics:

  For more information about numeric format specifiers, see Standard Numeric Format Strings and Custom Numeric Format Strings.

  For more information about formatting, see Formatting Types.

  The parameter is an implementation whose method returns a object. Typically, is a or object. The parameter supplies culture-specific information used in formatting. If is null, the thread current culture is used.

  Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.

  The string representation of the value of this instance as specified by and .

  A numeric format string (see Remarks). An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  The return value is the integral part of the decimal value; fractional digits are truncated.

  Converts the value of the specified to the equivalent 16-bit unsigned integer.

  A 16-bit unsigned integer equivalent to the value of .

  The decimal number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  The return value is the integral part of the decimal value; fractional digits are truncated.

  Converts the value of the specified to the equivalent 32-bit unsigned integer.

  A 32-bit unsigned integer equivalent to the value of .

  The decimal number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  The return value is the integral part of the decimal value; fractional digits are truncated.

  Converts the value of the specified to the equivalent 64-bit unsigned integer.

  A 64-bit unsigned integer equivalent to the value of .

  The decimal number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal ``

  The following example demonstrates using the method.

  `using System; class MyClass { public static void Main() { decimal d1 = 1234.56789m; decimal d2 = -1234.56789m; Console.WriteLine("{0} truncated is {1}", d1, Decimal.Truncate(d1)); Console.WriteLine("{0} truncated is {1}", d2, Decimal.Truncate(d2)); } }`

  The output is

  1234.56789 truncated is 1234

  -1234.56789 truncated is -1234

  This method rounds toward zero, to the nearest whole number, which corresponds to discarding any digits after the decimal point.

  Returns the integral digits of the specified ; any fractional digits are discarded.

  The result of rounded toward zero, to the nearest whole number.

  The decimal number to truncate. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` To be added. To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added.
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal 0

  The value of this constant is 0. The scale shall be 0.

  This field is read-only.

  Represents the number zero (0).

  0
0