Decimal Methods

# Decimal Methods

.NET Framework 4.6 and 4.5

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

## Methods

NameDescription

Ceiling(Decimal)

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

Compare(Decimal, Decimal)

Compares two specified Decimal values.

CompareTo(Decimal)

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

CompareTo(Object)

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

Divide(Decimal, Decimal)

Divides two specified Decimal values.

Equals(Decimal)

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

Equals(Decimal, Decimal)

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

Equals(Object)

Returns a value indicating whether this instance and a specified Object represent the same type and value.(Overrides ValueType.Equals(Object).)

Floor(Decimal)

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

FromOACurrency(Int64)

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

GetBits(Decimal)

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

GetHashCode()

Returns the hash code for this instance.(Overrides ValueType.GetHashCode().)

GetType()

Gets the Type of the current instance.(Inherited from Object.)

GetTypeCode()

Returns the TypeCode for value type Decimal.

Multiply(Decimal, Decimal)

Multiplies two specified Decimal values.

Negate(Decimal)

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

Parse(String)

Converts the string representation of a number to its Decimal equivalent.

Parse(String, IFormatProvider)

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

Parse(String, NumberStyles)

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

Parse(String, NumberStyles, IFormatProvider)

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

Remainder(Decimal, Decimal)

Computes the remainder after dividing two Decimal values.

Round(Decimal)

Rounds a decimal value to the nearest integer.

Round(Decimal, Int32)

Rounds a Decimal value to a specified number of decimal places.

Round(Decimal, Int32, MidpointRounding)

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

Round(Decimal, MidpointRounding)

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

Subtract(Decimal, Decimal)

Subtracts one specified Decimal value from another.

ToByte(Decimal)

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

ToDouble(Decimal)

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

ToInt16(Decimal)

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

ToInt32(Decimal)

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

ToInt64(Decimal)

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

ToOACurrency(Decimal)

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

ToSByte(Decimal)

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

ToSingle(Decimal)

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

ToString()

Converts the numeric value of this instance to its equivalent string representation.(Overrides ValueType.ToString().)

ToString(IFormatProvider)

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

ToString(String)

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

ToString(String, IFormatProvider)

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

ToUInt16(Decimal)

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

ToUInt32(Decimal)

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

ToUInt64(Decimal)

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

Truncate(Decimal)

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

TryParse(String, Decimal)

Converts the string representation of a number to its Decimal equivalent. A return value indicates whether the conversion succeeded or failed.

TryParse(String, NumberStyles, IFormatProvider, Decimal)

Converts the string representation of a number to its Decimal equivalent using the specified style and culture-specific format. A return value indicates whether the conversion succeeded or failed.

## Explicit Interface Implementations

NameDescription
IConvertible.ToBoolean(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IConvertible.ToBoolean.

IConvertible.ToByte(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IConvertible.ToByte.

IConvertible.ToChar(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

IConvertible.ToDateTime(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. This conversion is not supported. Attempting to use this method throws an InvalidCastException.

IConvertible.ToDecimal(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IConvertible.ToDecimal.

IConvertible.ToDouble(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IConvertible.ToDouble.

IConvertible.ToInt16(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IConvertible.ToInt16.

IConvertible.ToInt32(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IConvertible.ToInt32.

IConvertible.ToInt64(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IConvertible.ToInt64.

IConvertible.ToSByte(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IConvertible.ToSByte.

IConvertible.ToSingle(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IConvertible.ToSingle.

IConvertible.ToType(Type, IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IConvertible.ToType.

IConvertible.ToUInt16(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IConvertible.ToUInt16.

IConvertible.ToUInt32(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IConvertible.ToInt32.

IConvertible.ToUInt64(IFormatProvider)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IConvertible.ToInt64.

IDeserializationCallback.OnDeserialization(Object)

This API supports the product infrastructure and is not intended to be used directly from your code. Runs when the deserialization of an object has been completed.