Skip Headers

Oracle® Data Provider for .NET Developer's Guide
Release 9.2.0.4

Part Number B10961-01
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to beginning of chapter Go to next page

Oracle.DataAccess.Types Namespace (ODP.NET Types), 4 of 19


OracleDecimal Structure

The OracleDecimal structure represents an Oracle NUMBER in the database or any Oracle numeric value.

Class Inheritance

Object

  ValueType

    OracleDecimal

Declaration
// C#
public struct OracleDecimal : IComparable
Thread Safety

All public static methods are thread-safe, although instance methods do not guarantee thread safety.

Remarks

OracleDecimal can store up to 38 precision, while the .NET Decimal datatype can only hold up to 28 precision. When accessing the OracleDecimal.Value property from an OracleDecimal that has a value greater than 28 precision, loss of precision can occur. To retrieve the actual value of OracleDecimal, use the OracleDecimal.ToString() method. Another approach is to obtain the OracleDecimal value as a byte array in an internal Oracle NUMBER format through the BinData property.

Example
// C#
// Illustrates the usage of OracleDecimal
OracleDecimal pi = OracleDecimal.Pi;
// Use of implicit operator OracleDecimal(int)
OracleDecimal approxPi = OracleDecimal.Divide(22,7);

// Round the difference to 5 decimal places
OracleDecimal diff=OracleDecimal.Round(OracleDecimal.Abs(pi -approxPi),5);

// Set the format for ToString() - display with trailing zeroes
diff.Format = "9.9999900";
Console.WriteLine(diff.ToString());

Requirements

Namespace: Oracle.DataAccess.Types

Assembly: Oracle.DataAccess.dll

See Also:

OracleDecimal Members

OracleDecimal members are listed in the following tables:

OracleDecimal Constructors

OracleDecimal constructors are listed in Table 5-27

Table 5-27 OracleDecimal Constructors
Constructor Description

OracleDecimal Constructors

Instantiates a new instance of OracleDecimal structure (Overloaded)

OracleDecimal Static Fields

The OracleDecimal static fields are listed in Table 5-28.

Table 5-28 OracleDecimal Static Fields  
Field Description

MaxPrecision

A constant representing the maximum precision, which is 38

MaxScale

A constant representing the maximum scale, which is 127

MaxValue

A constant representing the maximum value for this structure, which is 9.9...9 x 10125

MinScale

A constant representing the minimum scale, which is -84

MinValue

A constant representing the minimum value for this structure, which is -1.0 x 10130

NegativeOne

A constant representing the negative one value

Null

Represents a null value that can be assigned to an OracleDecimal instance

One

A constant representing the positive one value

Pi

A constant representing the numeric Pi value

Zero

A constant representing the zero value

OracleDecimal Static (Comparison) Methods

The OracleDecimal static (comparison) methods are listed in Table 5-29.

Table 5-29 OracleDecimal Static (Comparison) Methods  
Methods Description

Equals

Determines if two OracleDecimal values are equal (Overloaded)

GreaterThan

Determines if the first of two OracleDecimal values is greater than the second

GreaterThanOrEqual

Determines if the first of two OracleDecimal values is greater than or equal to the second

LessThan

Determines if the first of two OracleDecimal values is less than the second

LessThanOrEqual

Determines if the first of two OracleDecimal values is less than or equal to the second.

NotEquals

Determines if two OracleDecimal values are not equal

OracleDecimal Static (Manipulation) Methods

The OracleDecimal static (manipulation) methods are listed in Table 5-30.

Table 5-30 OracleDecimal Static (Manipulation) Methods  
Methods Description

Abs

Returns the absolute value of an OracleDecimal

Add

Adds two OracleDecimal structures

AdjustScale

Returns a new OracleDecimal with the specified number of digits and indicates whether or not to round or truncate the number if the scale is less than original

Ceiling

Returns a new OracleDecimal structure with its value set to the ceiling of an OracleDecimal structure

ConvertToPrecScale

Returns a new OracleDecimal structure with a new precision and scale

Divide

Divides one OracleDecimal value by another

Floor

Returns a new OracleDecimal structure with its value set to the floor of an OracleDecimal structure

Max

Returns the maximum value of the two supplied OracleDecimal structures

Min

Returns the minimum value of the two supplied OracleDecimal structures

Mod

Returns a new OracleDecimal structure with its value set to the modulus of two OracleDecimal structures

Multiply

Returns a new OracleDecimal structure with its value set to the result of multiplying two OracleDecimal structures

Negate

Returns a new OracleDecimal structure with its value set to the negation of the supplied OracleDecimal structure

Parse

Converts a string to an OracleDecimal

Round

Returns a new OracleDecimal structure with its value set to that of the supplied OracleDecimal structure and rounded off to the specified place

SetPrecision

Returns a new OracleDecimal structure with a new specified precision.

Shift

Returns a new OracleDecimal structure with its value set to that of the supplied OracleDecimal structure, and its decimal place shifted to the specified number of places to the right

Sign

Determines the sign of an OracleDecimal structure

Sqrt

Returns a new OracleDecimal structure with its value set to the square root of the supplied OracleDecimal structure

Subtract

Returns a new OracleDecimal structure with its value set to result of subtracting one OracleDecimal structure from another

Truncate

Truncates the OracleDecimal at a specified position

OracleDecimal Static (Logarithmic) Methods

The OracleDecimal static (logarithmic) methods are listed in Table 5-31.

Table 5-31 OracleDecimal Static (Logarithmic) Methods  
Methods Description

Exp

Returns a new OracleDecimal structure with its value set to e raised to the supplied power

Log

Returns the supplied OracleDecimal structure with its value set to the logarithm of the supplied OracleDecimal structure (Overloaded)

Pow

Returns a new OracleDecimal structure with its value set to the supplied OracleDecimal structure raised to the supplied power (Overloaded)

OracleDecimal Static (Trigonometric) Methods

The OracleDecimal static (trigonometric) methods are listed in Table 5-32.

Table 5-32 OracleDecimal Static (Trigonometric) Methods  
Methods Description

Acos

Returns an angle in radian whose cosine is the supplied OracleDecimal structure

Asin

Returns an angle in radian whose sine is the supplied OracleDecimal structure

Atan

Returns an angle in radian whose tangent is the supplied OracleDecimal structure

Atan2

Returns an angle in radian whose tangent is the quotient of the two supplied OracleDecimal structures

Cos

Returns the cosine of the supplied angle in radian

Sin

Returns the sine of the supplied angle in radian

Tan

Returns the tangent of the supplied angle in radian

Cosh

Returns the hyperbolic cosine of the supplied angle in radian

Sinh

Returns the hyperbolic sine of the supplied angle in radian

Tanh

Returns the hyperbolic tangent of the supplied angle in radian

OracleDecimal Static (Comparison) Operators

The OracleDecimal static (comparison) operators are listed in Table 5-33.

Table 5-33 OracleDecimal Static (Comparison) Operators  
Operator Description

operator +

Adds two OracleDecimal values

operator /

Divides one OracleDecimal value by another

operator ==

Determines if the two OracleDecimal values are equal

operator >

Determines if the first of two OracleDecimal values is greater than the second

operator >=

Determines if the first of two OracleDecimal values is greater than or equal to the second

operator !=

Determines if the two OracleDecimal values are not equal

operator <

Determines if the first of two OracleDecimal values is less than the second

operator <=

Determines if the first of two OracleDecimal values is less than or equal to the second

operator *

Multiplies two OracleDecimal structures

operator -

Subtracts one OracleDecimal structure from another

operator -

Negates an OracleDecimal structure

operator%

Returns a new OracleDecimal structure with its value set to the modulus of two OracleDecimal structures.

OracleDecimal Static Operators (Conversion from .NET Type to OracleDecimal)

The OracleDecimal static operators (Conversion from .NET Type to OracleDecimal) are listed in Table 5-34.

Table 5-34 OracleDecimal Static Operators (Conversion from .NET Type to OracleDecimal)  
Operator Description

implicit operator OracleDecimal

Converts an instance value to an OracleDecimal structure (Overloaded)

explicit operator OracleDecimal

Converts an instance value to an OracleDecimal structure (Overloaded)

OracleDecimal Static Operators (Conversion from OracleDecimal to .NET)

The OracleDecimal static operators (Conversion from OracleDecimal to .NET) are listed in Table 5-35.

Table 5-35 OracleDecimal Static Operators (Conversion from OracleDecimal to .NET)  
Operator Description

explicit operator byte

Returns the byte representation of the OracleDecimal value

explicit operator decimal

Returns the decimal representation of the OracleDecimal value

explicit operator double

Returns the double representation of the OracleDecimal value

explicit operator short

Returns the short representation of the OracleDecimal value

explicit operator int

Returns the int representation of the OracleDecimal value

explicit operator long

Returns the long representation of the OracleDecimal value

explicit operator float

Returns the float representation of the OracleDecimal value

OracleDecimal Properties

The OracleDecimal properties are listed in Table 5-36.

Table 5-36 OracleDecimal Properties  
Properties Description

BinData

Returns a byte array that represents the Oracle NUMBER in Oracle internal format

Format

Specifies the format for ToString()

IsInt

Indicates whether the current instance is an integer

IsNull

Indicates whether the current instance has a null value

IsPositive

Indicates whether the current instance is greater than 0

IsZero

Indicates whether the current instance has a zero value

Value

Returns a decimal value

OracleDecimal Instance Methods

The OracleDecimal instance methods are listed in Table 5-37.

Table 5-37 OracleDecimal Instance Methods  
Method Description

CompareTo

Compares the current instance to the supplied object and returns an integer that represents their relative values

Equals

Determines whether an object is an instance of OracleDecimal, and whether the value of the object is equal to the current instance (Overloaded)

GetHashCode

Returns a hash code for the current instance

GetType

Inherited from Object

ToByte

Returns the byte representation of the current instance

ToDouble

Returns the double representation of the current instance

ToInt16

Returns the Int16 representation of the current instance

ToInt32

Returns the Int32 representation of the current instance

ToInt64

Returns the Int64 representation of the current instance

ToSingle

Returns the Single representation of the current instance

ToString

Overloads Object.ToString()

Returns the string representation of the current instance

See Also:

OracleDecimal Constructors

The OracleDecimal constructors instantiate a new instance of the OracleDecimal structure.

Overload List:

OracleDecimal(byte [ ])

This constructor creates a new instance of the OracleDecimal structure and sets its value to the supplied byte array, which is in an Oracle NUMBER format.

Declaration
// C#
public OracleDecimal(byte [] bytes);
Parameters
Exceptions

ArgumentException - The bytes parameter is not in a internal Oracle NUMBER format or bytes has an invalid value.

ArgumentNullException - The bytes parameter is null.

See Also:

OracleDecimal(decimal)

This constructor creates a new instance of the OracleDecimal structure and sets its value to the supplied Decimal value.

Declaration
// C#
public OracleDecimal(decimal decX); 
Parameters

OracleDecimal(double)

This constructor creates a new instance of the OracleDecimal structure and sets its value to the supplied double value.

Declaration
// C#
public OracleDecimal(double doubleX)
Parameters
Exceptions

OverFlowException - The value of the supplied double is greater than the maximum value or less than the minimum value of OracleDecimal.

Remarks

OracleDecimal contains the following values depending on the provided double value:

OracleDecimal(int)

This constructor creates a new instance of the OracleDecimal structure and sets its value to the supplied Int32 value.

Declaration
// C#
public OracleDecimal(int intX);
Parameters

OracleDecimal(float)

This constructor creates a new instance of the OracleDecimal structure and sets its value to the supplied Single value.

Declaration
// C#
public OracleDecimal(float floatX);
Parameters
Remarks

OracleDecimal contains the following values depending on the provided float value:

float.PositiveInfinity: positive infinity value

float.NegativeInfinity: negative infinity value

float.NaN: null value

See Also:

OracleDecimal(long)

This constructor creates a new instance of the OracleDecimal structure and sets its value to the supplied Int64 value.

Declaration
// C#
public OracleDecimal(long longX);
Parameters

OracleDecimal(string)

This constructor creates a new instance of the OracleDecimal structure and sets its value to the supplied string value.

Declaration
// C#
public OracleDecimal(string numStr);
Parameters
Exceptions

ArgumentException - The numStr parameter is an invalid string representation of an OracleDecimal.

ArgumentNullException - The numStr parameter is null.

OverFlowException - The value of numStr is greater than the maximum value or less than the minimum value of OracleDecimal.

See Also:

OracleDecimal(string, string)

This constructor creates a new instance of the OracleDecimal structure with the supplied string value and number format.

Declaration
// C#
public OracleDecimal(string numStr, string format);
Parameters
Exceptions

ArgumentException - The numStr parameter is an invalid string representation of an OracleDecimal or the numStr is not in the numeric format specified by format.

ArgumentNullException - The numStr parameter is null.

OverFlowException - The value of numStr parameter is greater than the maximum value or less than the minimum value of OracleDecimal.

Remarks

If the numeric format includes decimal and group separators, then the provided string must use those characters defined by the OracleGlobalization.NumericCharacters of the thread.

If the numeric format includes the currency symbol, ISO currency symbol, or the dual currency symbol, then the provided string must use those symbols defined by the OracleGlobalization.Currency, OracleGlobalization.ISOCurrency, and OracleGlobalization.DualCurrency properties respectively.

Example
// C#
// Set the nls parameters to be used in the numeric format
OracleGlobalization og = OracleGlobalization.GetClientInfo();
og.Currency = "$";
og.NumericCharacters = ".,";
OracleGlobalization.SetThreadInfo(og);

// Construct an OracleDecimal using a valid numeric format
OracleDecimal od = new OracleDecimal("$2,222.22","L9G999D99");
Console.WriteLine(od.ToString()); // Prints $2,222.22

See Also:

OracleDecimal Static Fields

The OracleDecimal static fields are listed in Table 5-38.

Table 5-38 OracleDecimal Static Fields  
Field Description

MaxPrecision

A constant representing the maximum precision, which is 38

MaxScale

A constant representing the maximum scale, which is 127

MaxValue

A constant representing the maximum value for this structure, which is 9.9...9 x 10125

MinScale

A constant representing the minimum scale, which is -84

MinValue

A constant representing the minimum value for this structure, which is -1.0 x 10130

NegativeOne

A constant representing the negative one value

Null

Represents a null value that can be assigned to an OracleDecimal instance

One

A constant representing the positive one value

Pi

A constant representing the numeric Pi value

Zero

A constant representing the zero value

See Also:

MaxPrecision

This static field represents the maximum precision, which is 38.

Declaration
// C#
public static readonly byte MaxPrecision;

See Also:

MaxScale

This static field a constant representing the maximum scale, which is 127.

Declaration
// C#
public static readonly byte MaxScale;

See Also:

MaxValue

This static field indicates a constant representing the maximum value for this structure, which is 9.9...9 x 10125 (38 nines followed by 88 zeroes).

Declaration
// C#
public static readonly OracleDecimal MaxValue;

See Also:

MinScale

This static field indicates a constant representing the maximum scale, which is -84.

Declaration
// C#
public static readonly int MinScale;

See Also:

MinValue

This static field indicates a constant representing the minimum value for this structure, which is -1.0 x 10130.

Declaration
// C#
public static readonly OracleDecimal MinValue;

See Also:

NegativeOne

This static field indicates a constant representing the negative one value.

Declaration
// C#
public static readonly OracleDecimal NegativeOne;

See Also:

Null

This static field represents a null value that can be assigned to an OracleDecimal instance.

Declaration
// C#
public static readonly OracleDecimal Null;

See Also:

One

This static field indicates a constant representing the positive one value.

Declaration
// C#
public static readonly OracleDecimal One;

See Also:

Pi

This static field indicates a constant representing the numeric Pi value.

Declaration
// C#
public static readonly OracleDecimal Pi;

See Also:

Zero

This static field indicates a constant representing the zero value.

Declaration
// C#
public static readonly OracleDecimal Zero;

See Also:

OracleDecimal Static (Comparison) Methods

The OracleDecimal static (comparison) methods are listed in Table 5-39.

Table 5-39 OracleDecimal Static (Comparison) Methods  
Methods Description

Equals

Determines if two OracleDecimal values are equal (Overloaded)

GreaterThan

Determines if the first of two OracleDecimal values is greater than the second

GreaterThanOrEqual

Determines if the first of two OracleDecimal values is greater than or equal to the second

LessThan

Determines if the first of two OracleDecimal values is less than the second

LessThanOrEqual

Determines if the first of two OracleDecimal values is less than or equal to the second.

NotEquals

Determines if two OracleDecimal values are not equal

See Also:

Equals

This method determines if two OracleDecimal values are equal.

Declaration
// C#
public static bool Equals(OracleDecimal value1, OracleDecimal value2);
Parameters
Return Value

Returns true if two OracleDecimal values are equal; otherwise, returns false.

Remarks

The following rules apply to the behavior of this method.

GreaterThan

This method determines if the first of two OracleDecimal values is greater than the second.

Declaration
// C#
public static bool GreaterThan(OracleDecimal value1, OracleDecimal value2);
Parameters
Return Value

Returns true if the first of two OracleDecimal values is greater than the second; otherwise, returns false.

Remarks

The following rules apply to the behavior of this method.

GreaterThanOrEqual

This method determines if the first of two OracleDecimal values is greater than or equal to the second.

Declaration
// C#
public static bool GreaterThanOrEqual(OracleDecimal value1, OracleDecimal 
value2);
Parameters
Return Value

Returns true if the first of two OracleDecimal values is greater than or equal to the second; otherwise, returns false.

Remarks

The following rules apply to the behavior of this method.

LessThan

This method determines if the first of two OracleDecimal values is less than the second.

Declaration
// C#
public static bool LessThan(OracleDecimal value1, OracleDecimal value2);
Parameters
Return Value

Returns true if the first of two OracleDecimal values is less than the second; otherwise, returns false.

Remarks

The following rules apply to the behavior of this method.

LessThanOrEqual

This method determines if the first of two OracleDecimal values is less than or equal to the second.

Declaration
// C#
public static bool LessThanOrEqual(OracleDecimal value1, OracleDecimal value2);
Parameters
Return Value

Returns true if the first of two OracleDecimal values is less than or equal to the second; otherwise, returns false.

Remarks

The following rules apply to the behavior of this method.

NotEquals

This method determines if two OracleDecimal values are not equal.

Declaration
// C#
public static bool NotEquals(OracleDecimal value1, OracleDecimal value2);
Parameters
Return Value

Returns true if two OracleDecimal values are not equal; otherwise, returns false.

Remarks

The following rules apply to the behavior of this method.

OracleDecimal Static (Manipulation) Methods

The OracleDecimal static (manipulation) methods are listed in Table 5-40.

Table 5-40 OracleDecimal Static (Manipulation) Methods  
Methods Description

Abs

Returns the absolute value of an OracleDecimal

Add

Adds two OracleDecimal structures

AdjustScale

Returns a new OracleDecimal with the specified number of digits and indicates whether or not to round or truncate the number if the scale is less than original

Ceiling

Returns a new OracleDecimal structure with its value set to the ceiling of an OracleDecimal structure

ConvertToPrecScale

Returns a new OracleDecimal structure with a new precision and scale

Divide

Divides one OracleDecimal value by another

Floor

Returns a new OracleDecimal structure with its value set to the floor of an OracleDecimal structure

Max

Returns the maximum value of the two supplied OracleDecimal structures

Min

Returns the minimum value of the two supplied OracleDecimal structures

Mod

Returns a new OracleDecimal structure with its value set to the modulus of two OracleDecimal structures

Multiply

Returns a new OracleDecimal structure with its value set to the result of multiplying two OracleDecimal structures

Negate

Returns a new OracleDecimal structure with its value set to the negation of the supplied OracleDecimal structure

Parse

Converts a string to an OracleDecimal

Round

Returns a new OracleDecimal structure with its value set to that of the supplied OracleDecimal structure and rounded off to the specified place

SetPrecision

Returns a new OracleDecimal structure with a new specified precision.

Shift

Returns a new OracleDecimal structure with its value set to that of the supplied OracleDecimal structure, and its decimal place shifted to the specified number of places to the right

Sign

Determines the sign of an OracleDecimal structure

Sqrt

Returns a new OracleDecimal structure with its value set to the square root of the supplied OracleDecimal structure

Subtract

Returns a new OracleDecimal structure with its value set to result of subtracting one OracleDecimal structure from another

Truncate

Truncates the OracleDecimal at a specified position

See Also:

Abs

This method returns the absolute value of an OracleDecimal.

Declaration
// C#
public static OracleDecimal Abs(OracleDecimal val);
Parameters
Return Value

The absolute value of an OracleDecimal.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Add

This method adds two OracleDecimal structures.

Declaration
// C#
public static OracleDecimal Add(OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

Returns an OracleDecimal structure.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

AdjustScale

This method returns a new OracleDecimal with the specified number of digits and indicates whether or not to round or truncate the number if the scale is less than the original.

Declaration
// C#
public static OracleDecimal AdjustScale(OracleDecimal val, int digits,
     bool fRound);
Parameters
Return Value

An OracleDecimal.

Remarks

If the supplied OracleDecimal has a null value, the returned OracleDecimal has a null value.

Example
// C#
OracleDecimal od = new OracleDecimal(5.555); 
// Adjust Scale to 2 with rounding off
OracleDecimal odr = OracleDecimal.AdjustScale(od, 2, true);
Console.WriteLine(odr.ToString()); // Prints 5.56
// Adjust Scale to 2 with truncation
OracleDecimal odt = OracleDecimal.AdjustScale(od, 2, false);
Console.WriteLine(odt.ToString()); // Prints 5.55

See Also:

Ceiling

This method returns a new OracleDecimal structure with its value set to the ceiling of the supplied OracleDecimal.

Declaration
// C#
public static OracleDecimal Ceiling(OracleDecimal val);
Parameters
Return Value

A new OracleDecimal structure.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

ConvertToPrecScale

This method returns a new OracleDecimal structure with a new precision and scale.

Declaration
// C#
public static OracleDecimal ConvertToPrecScale(OracleDecimal val, int precision, 
  int scale);
Parameters
Return Value

A new OracleDecimal structure.

Remarks

If the supplied OracleDecimal has a null value, the returned OracleDecimal has a null value.

Example
// C#
OracleDecimal od = new OracleDecimal(555.6666);

// Set the precision of od to 5 and scale to 2
OracleDecimal odp5s2 = OracleDecimal.ConvertToPrecScale(od,5,2);
Console.WriteLine(odp5s2.ToString()); // Prints 555.67

// Set the precision of od to 3 and scale to 0
OracleDecimal odp3s0 = OracleDecimal.ConvertToPrecScale(od,3,0);
Console.WriteLine(odp3s0.ToString()); // Prints 556

See Also:

Divide

This method divides one OracleDecimal value by another.

Declaration
// C#
public static OracleDecimal Divide(OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

A new OracleDecimal structure.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Floor

This method returns a new OracleDecimal structure with its value set to the floor of the supplied OracleDecimal structure.

Declaration
// C#
public static OracleDecimal Floor(OracleDecimal val);
Parameters
Return Value

A new OracleDecimal structure.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Max

This method returns the maximum value of the two supplied OracleDecimal structures.

Declaration
// C#
public static OracleDecimal Max(OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

An OracleDecimal structure that has the greater value.

See Also:

Min

This method returns the minimum value of the two supplied OracleDecimal structures.

Declaration
// C#
public static OracleDecimal Min(OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

An OracleDecimal structure that has the smaller value.

See Also:

Mod

This method returns a new OracleDecimal structure with its value set to the modulus of two OracleDecimal structures.

Declaration
// C#
public static OracleDecimal Mod(OracleDecimal val1, OracleDecimal divider);
Parameters
Return Value

An OracleDecimal.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Multiply

This method returns a new OracleDecimal structure with its value set to the result of multiplying two OracleDecimal structures.

Declaration
// C#
public static OracleDecimal Multiply(OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

A new OracleDecimal structure.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Negate

This method returns a new OracleDecimal structure with its value set to the negation of the supplied OracleDecimal structures.

Declaration
// C#
public static OracleDecimal Negate(OracleDecimal val);
Parameters
Return Value

A new OracleDecimal structure.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Parse

This method converts a string to an OracleDecimal.

Declaration
// C#
public static OracleDecimal Parse (string str);
Parameters
Return Value

A new OracleDecimal structure.

Exceptions

ArgumentException - The numStr parameter is an invalid string representation of an OracleDecimal.

ArgumentNullException - The numStr parameter is null.

OverFlowException - The value of numStr is greater than the maximum value or less than the minimum value of OracleDecimal.

See Also:

Round

This method returns a new OracleDecimal structure with its value set to that of the supplied OracleDecimal structure and rounded off to the specified place.

Declaration
// C#
public static OracleDecimal Round(OracleDecimal val, int decplace);
Parameters
Return Value

An OracleDecimal structure.

Remarks

If the supplied OracleDecimal structure has a null value, the returned OracleDecimal has a null value.

See Also:

SetPrecision

This method returns a new OracleDecimal structure with a new specified precision.

Declaration
// C#
public static OracleDecimal SetPrecision(OracleDecimal val, int precision);
Parameters
Return Value

An OracleDecimal structure.

Remarks

The returned OracleDecimal is rounded off if the specified precision is smaller than the precision of val.

If val has a null value, the returned OracleDecimal has a null value.

Example
// C#
OracleDecimal od = new OracleDecimal(555.6666);

// Set the precision of od to 3
OracleDecimal odp3 = OracleDecimal.SetPrecision(od,3);
Console.WriteLine(odp3.ToString()); // Prints 556

// Set the precision of od to 4
OracleDecimal odp4 = OracleDecimal.SetPrecision(od,4);
Console.WriteLine(odp4.ToString()); // Prints 555.7

See Also:

Shift

This method returns a new OracleDecimal structure with its value set to that of the supplied OracleDecimal structure, and its decimal place shifted to the specified number of places to the right.

Declaration
// C#
public static OracleDecimal Shift(OracleDecimal val, int decplaces);
Parameters
Return Value

An OracleDecimal structure.

Remarks

If the supplied OracleDecimal structure has a null value, the returned OracleDecimal has a null value.

If decplaces is negative, the shift is to the left.

See Also:

Sign

This method determines the sign of an OracleDecimal structure.

Declaration
// C#
public static int Sign(OracleDecimal val);
Parameters
Return Value
Exceptions

OracleNullValueException - The argument has a null value.

See Also:

Sqrt

This method returns a new OracleDecimal structure with its value set to the square root of the supplied OracleDecimal structure.

Declaration
// C#
public static OracleDecimal Sqrt(OracleDecimal val);
Parameters
Return Value

An OracleDecimal structure.

Exceptions

ArgumentOutOfRangeException - The provided OracleDecimal structure is less than zero.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Subtract

This method returns a new OracleDecimal structure with its value set to result of subtracting one OracleDecimal structure from another.

Declaration
// C#
public static OracleDecimal Subtract(OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

An OracleDecimal structure.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Truncate

This method truncates the OracleDecimal at a specified position.

Declaration
// C#
public static OracleDecimal Truncate(OracleDecimal val, int pos);
Parameters
Return Value

An OracleDecimal structure.

Remarks

If the supplied OracleDecimal structure has a null value, the returned OracleDecimal has a null value.

See Also:

OracleDecimal Static (Logarithmic) Methods

The OracleDecimal static (logarithmic) methods are listed in Table 5-41.

Table 5-41 OracleDecimal Static (Logarithmic) Methods  
Methods Description

Exp

Returns a new OracleDecimal structure with its value set to e raised to the supplied power

Log

Returns the supplied OracleDecimal structure with its value set to the logarithm of the supplied OracleDecimal structure (Overloaded)

Pow

Returns a new OracleDecimal structure with its value set to the supplied OracleDecimal structure raised to the supplied power (Overloaded)

See Also:

Exp

This method returns a new OracleDecimal structure with its value set to e raised to the supplied OracleDecimal.

Declaration
// C#
public static OracleDecimal Exp(OracleDecimal val);
Parameters
Return Value

An OracleDecimal structure.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Log

Log returns the supplied OracleDecimal structure with its value set to the logarithm of the supplied OracleDecimal structure.

Overload List:

Log(OracleDecimal)

This method returns a new OracleDecimal structure with its value set to the natural logarithm (base e) of the supplied OracleDecimal structure.

Declaration
// C#
public static OracleDecimal Log(OracleDecimal val);
Parameters
Return Value

Returns a new OracleDecimal structure with its value set to the natural logarithm (base e) of val.

Exceptions

ArgumentOutOfRangeException - The supplied OracleDecimal value is less than zero.

Remarks

If the supplied OracleDecimal structure has a null value, the returned OracleDecimal has a null value.

If the supplied OracleDecimal structure has zero value, the result is undefined, and the returned OracleDecimal structure has a null value.

See Also:

Log(OracleDecimal, int)

This method returns the supplied OracleDecimal structure with its value set to the logarithm of the supplied OracleDecimal structure in the supplied base.

Declaration
// C#
public static OracleDecimal Log(OracleDecimal val, int logBase);
Parameters
Return Value

A new OracleDecimal structure with its value set to the logarithm of val in the supplied base.

Exceptions

ArgumentOutOfRangeException - Either argument is less than zero.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

If both arguments have zero value, the result is undefined, and the returned OracleDecimal structure has a null value.

See Also:

Log(OracleDecimal, OracleDecimal)

This method returns the supplied OracleDecimal structure with its value set to the logarithm of the supplied OracleDecimal structure in the supplied base.

Declaration
// C#
public static OracleDecimal Log(OracleDecimal val, OracleDecimal logBase);
Parameters
Return Value

Returns the logarithm of val in the supplied base.

Exceptions

ArgumentOutOfRangeException - Either the val or logBase parameter is less than zero.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

If both arguments have zero value, the result is undefined, and the returned OracleDecimal structure has a null value.

See Also:

Pow

Pow returns a new OracleDecimal structure with its value set to the supplied OracleDecimal structure raised to the supplied power.

Overload List:

Pow(OracleDecimal, int)

This method returns a new OracleDecimal structure with its value set to the supplied OracleDecimal value raised to the supplied Int32 power.

Declaration
// C#
public static OracleDecimal Pow(OracleDecimal val, int power);
Parameters
Return Value

An OracleDecimal structure.

Remarks

If the supplied OracleDecimal structure has a null value, the returned OracleDecimal has a null value.

See Also:

Pow(OracleDecimal, OracleDecimal)

This method returns a new OracleDecimal structure with its value set to the supplied OracleDecimal structure raised to the supplied OracleDecimal power.

Declaration
// C#
public static OracleDecimal Pow(OracleDecimal val, OracleDecimal power);
Parameters
Return Value

An OracleDecimal structure.

Remarks

If the supplied OracleDecimal structure has a null value, the returned OracleDecimal has a null value.

See Also:

OracleDecimal Static (Trigonometric) Methods

The OracleDecimal static (trigonometric) methods are listed in Table 5-42.

Table 5-42 OracleDecimal Static (Trigonometric) Methods  
Methods Description

Acos

Returns an angle in radian whose cosine is the supplied OracleDecimal structure

Asin

Returns an angle in radian whose sine is the supplied OracleDecimal structure

Atan

Returns an angle in radian whose tangent is the supplied OracleDecimal structure

Atan2

Returns an angle in radian whose tangent is the quotient of the two supplied OracleDecimal structures

Cos

Returns the cosine of the supplied angle in radian

Sin

Returns the sine of the supplied angle in radian

Tan

Returns the tangent of the supplied angle in radian

Cosh

Returns the hyperbolic cosine of the supplied angle in radian

Sinh

Returns the hyperbolic sine of the supplied angle in radian

Tanh

Returns the hyperbolic tangent of the supplied angle in radian

See Also:

Acos

This method returns an angle in radian whose cosine is the supplied OracleDecimal structure.

Declaration
// C#
public static OracleDecimal Acos(OracleDecimal val);
Parameters
Return Value

An OracleDecimal structure that represents an angle in radian.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Asin

This method returns an angle in radian whose sine is the supplied OracleDecimal structure.

Declaration
// C#
public static OracleDecimal Asin(OracleDecimal val);
Parameters
Return Value

An OracleDecimal structure that represents an angle in radian.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Atan

This method returns an angle in radian whose tangent is the supplied OracleDecimal structure

Declaration
// C#
public static OracleDecimal Atan(OracleDecimal val);
Parameters
Return Value

An OracleDecimal structure that represents an angle in radian.

Remarks

If the argument has a null value, the returned OracleDecimal has a null value.

See Also:

Atan2

This method returns an angle in radian whose tangent is the quotient of the two supplied OracleDecimal structures.

Declaration
// C#
public static OracleDecimal Atan2(OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

An OracleDecimal structure that represents an angle in radian.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Cos

This method returns the cosine of the supplied angle in radian.

Declaration
// C#
public static OracleDecimal Cos(OracleDecimal val);
Parameters
Return Value

An OracleDecimal instance.

Exceptions

ArgumentOutOfRangeException - The val parameter is positive or negative infinity.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Sin

This method returns the sine of the supplied angle in radian.

Declaration
// C#
public static OracleDecimal Sin(OracleDecimal val);
Parameters
Return Value

An OracleDecimal structure that represents an angle in radian.

Exceptions

ArgumentOutOfRangeException - The val parameter is positive or negative infinity.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Tan

This method returns the tangent of the supplied angle in radian.

Declaration
// C#
public static OracleDecimal Tan(OracleDecimal val);
Parameters
Return Value

An OracleDecimal instance.

Exceptions

ArgumentOutOfRangeException - The val parameter is positive or negative infinity.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Cosh

This method returns the hyperbolic cosine of the supplied angle in radian.

Declaration
// C#
public static OracleDecimal Cosh(OracleDecimal val);
Parameters
Return Value

An OracleDecimal instance.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Sinh

This method returns the hyperbolic sine of the supplied angle in radian.

Declaration
// C#
public static OracleDecimal Sinh(OracleDecimal val);
Parameters
Return Value

An OracleDecimal instance.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

Tanh

This method returns the hyperbolic tangent of the supplied angle in radian.

Declaration
// C#
public static OracleDecimal Tanh(OracleDecimal val);
Parameters
Return Value

An OracleDecimal instance.

Remarks

If either argument has a null value, the returned OracleDecimal has a null value.

See Also:

OracleDecimal Static (Comparison) Operators

The OracleDecimal static (comparison) operators are listed in Table 5-43.

Table 5-43 OracleDecimal Static (Comparison) Operators  
Operator Description

operator +

Adds two OracleDecimal values

operator /

Divides one OracleDecimal value by another

operator ==

Determines if the two OracleDecimal values are equal

operator >

Determines if the first of two OracleDecimal values is greater than the second

operator >=

Determines if the first of two OracleDecimal values is greater than or equal to the second

operator !=

Determines if the two OracleDecimal values are not equal

operator <

Determines if the first of two OracleDecimal values is less than the second

operator <=

Determines if the first of two OracleDecimal values is less than or equal to the second

operator *

Multiplies two OracleDecimal structures

operator -

Subtracts one OracleDecimal structure from another

operator -

Negates an OracleDecimal structure

operator%

Returns a new OracleDecimal structure with its value set to the modulus of two OracleDecimal structures.

See Also:

operator +

This method adds two OracleDecimal values.

Declaration
// C#
public static OracleDecimal operator + (OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

An OracleDecimal structure.

Remarks

If either operand has a null value, the returned OracleDecimal has a null value.

See Also:

operator /

This method divides one OracleDecimalvalue by another.

Declaration
// C#
public static OracleDecimal operator / (OracleDecimal val1, OracleDecimal val2);
Parameters

Second OracleDecimal.

Return Value

An OracleDecimal structure.

Remarks

If either operand has a null value, the returned OracleDecimal has a null value.

See Also:

operator ==

This method determines if two OracleDecimal values are equal.

Declaration
// C#
public static bool operator == (OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

Returns true if their values are equal; otherwise, returns false.

Remarks

The following rules apply to the behavior of this method.

operator >

This method determines if the first of two OracleDecimal values is greater than the second.

Declaration
// C#
public static bool operator > (OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

Returns true if the two OracleDecimal values are not equal; otherwise, returns false.

Remarks

The following rules apply to the behavior of this method.

operator >=

This method determines if the first of two OracleDecimal values is greater than or equal to the second.

Declaration
// C#
public static bool operator >= (OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

Returns true if the first of two OracleDecimal values is greater than or equal to the second; otherwise, returns false.

Remarks

The following rules apply to the behavior of this method.

operator !=

This method determines if the first of two OracleDecimal values are not equal.

Declaration
// C#
public static bool operator != (OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

Returns true if the two OracleDecimal values are not equal; otherwise, returns false.

Remarks

The following rules apply to the behavior of this method.

operator <

This method determines if the first of two OracleDecimal values is less than the second.

Declaration
// C#
public static bool operator < (OracleDecimal val1,  OracleDecimal val2);
Parameters
Return Value

Returns true if the first of two OracleDecimal values is less than the second; otherwise, returns false.

Remarks

The following rules apply to the behavior of this method.

operator <=

This method determines if the first of two OracleDecimal values is less than or equal to the second.

Declaration
// C#
public static bool operator <= (OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

Returns true if the first of two OracleDecimal values is less than or equal to the second; otherwise, returns false.

Remarks

The following rules apply to the behavior of this method.

operator *

This method multiplies two OracleDecimal structures.

Declaration
// C#
public static OracleDecimal operator * (OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

A new OracleDecimal structure.

Remarks

If either operand has a null value, the returned OracleDecimal has a null value.

See Also:

operator -

This method subtracts one OracleDecimal structure from another.

Declaration
// C#
public static OracleDecimal operator - (OracleDecimal val1, OracleDecimal val2);
Parameters
Return Value

A new OracleDecimal structure.

Remarks

If either operand has a null value, the returned OracleDecimal has a null value.

See Also:

operator -

This method negates the supplied OracleDecimal structure.

Declaration
// C#
public static OracleDecimal operator - (OracleDecimal val);
Parameters
Return Value

A new OracleDecimal structure.

Remarks

If the supplied OracleDecimal structure has a null value, the returned OracleDecimal has a null value.

See Also:

operator%

This method returns a new OracleDecimal structure with its value set to the modulus of two OracleDecimal structures.

Declaration
// C#
public static OracleDecimal operator % (OracleDecimal val, 
     OracleDecimal divider);
Parameters
Return Value

A new OracleDecimal structure.

Remarks

If either operand has a null value, the returned OracleDecimal has a null value.

See Also:

OracleDecimal Static Operators (Conversion from .NET Type to OracleDecimal)

The OracleDecimal static operators (Conversion from .NET Type to OracleDecimal) are listed in Table 5-44.

Table 5-44 OracleDecimal Static Operators (Conversion from .NET Type to OracleDecimal)  
Operator Description

implicit operator OracleDecimal

Converts an instance value to an OracleDecimal structure (Overloaded)

explicit operator OracleDecimal

Converts an instance value to an OracleDecimal structure (Overloaded)

See Also:

implicit operator OracleDecimal

implicit operator OracleDecimal returns the OracleDecimal representation of a value.

Overload List:

implicit operator OracleDecimal(decimal)

This method returns the OracleDecimal representation of a decimal value.

Declaration
// C#
public static implicit operator OracleDecimal(decimal val);
Parameters
Return Value

An OracleDecimal.

See Also:

implicit operator OracleDecimal(int)

This method returns the OracleDecimal representation of an int value.

Declaration
// C#
public static implicit operator OracleDecimal(int val);
Parameters
Return Value

An OracleDecimal.

See Also:

implicit operator OracleDecimal(long)

This method returns the OracleDecimal representation of a long value.

Declaration
// C#
public static implicit operator OracleDecimal(long val);
Parameters
Return Value

An OracleDecimal.

See Also:

explicit operator OracleDecimal

OracleDecimal returns the OracleDecimal representation of a value.

Overload List:

explicit operator OracleDecimal(double)

This method returns the OracleDecimal representation of a double.

Declaration
// C#
public static explicit operator OracleDecimal(double val);
Parameters
Return Value

An OracleDecimal.

Exceptions

OverFlowException - The value of the supplied double is greater than the maximum value of OracleDecimal or less than the minimum value of OracleDecimal.

Remarks

OracleDecimal contains the following values depending on the provided double value:

explicit operator OracleDecimal(string)

This method returns the OracleDecimal representation of a string.

Declaration
// C#
public static explicit operator OracleDecimal(string numStr);
Parameters
Return Value

An OracleDecimal.

Exceptions

ArgumentException - The numStr parameter is an invalid string representation of an OracleDecimal.

See Also:

OracleDecimal Static Operators (Conversion from OracleDecimal to .NET)

The OracleDecimal static operators (Conversion from OracleDecimal to .NET) are listed in Table 5-45.

Table 5-45 OracleDecimal Static Operators (Conversion from OracleDecimal to .NET)  
Operator Description

explicit operator byte

Returns the byte representation of the OracleDecimal value

explicit operator decimal

Returns the decimal representation of the OracleDecimal value

explicit operator double

Returns the double representation of the OracleDecimal value

explicit operator short

Returns the short representation of the OracleDecimal value

explicit operator int

Returns the int representation of the OracleDecimal value

explicit operator long

Returns the long representation of the OracleDecimal value

explicit operator float

Returns the float representation of the OracleDecimal value

See Also:

explicit operator byte

This method returns the byte representation of the OracleDecimal value.

Declaration
// C#
public static explicit operator byte(OracleDecimal val);
Parameters
Return Value

A byte.

Exceptions

OracleNullValueException - OracleDecimal has a null value.

OverFlowException- The byte cannot represent the supplied OracleDecimal structure.

See Also:

explicit operator decimal

This method returns the decimal representation of the OracleDecimal value.

Declaration
// C#
public static explicit operator decimal(OracleDecimal val);
Parameters
Return Value

A decimal.

Exceptions

OracleNullValueException - The OracleDecimal has a null value.

OverFlowException - The decimal cannot represent the supplied OracleDecimal structure.

See Also:

explicit operator double

This method returns the double representation of the OracleDecimal value.

Declaration
// C#
public static explicit operator double(OracleDecimal val);
Parameters
Return Value

A double.

Exceptions

OracleNullValueException - The OracleDecimal has a null value.

OverFlowException - The double cannot represent the supplied OracleDecimal structure.

See Also:

explicit operator short

This method returns the short representation of the OracleDecimal value.

Declaration
// C#
public static explicit operator short(OracleDecimal val);
Parameters
Return Value

A short.

Exceptions

OracleNullValueException - The OracleDecimal has a null value.

OverFlowException - The short cannot represent the supplied OracleDecimal structure.

See Also:

explicit operator int

This method returns the int representation of the OracleDecimal value.

Declaration
// C#
public static explicit operator int(OracleDecimal val);
Parameters
Return Value

An int.

Exceptions

OracleNullValueException - The OracleDecimal has a null value.

OverFlowException - The int cannot represent the supplied OracleDecimal structure.

See Also:

explicit operator long

This method returns the long representation of the OracleDecimal value.

Declaration
// C#
public static explicit operator long(OracleDecimal val);
Parameters
Return Value

A long.

Exceptions

OracleNullValueException - The OracleDecimal has a null value.

OverFlowException - The long cannot represent the supplied OracleDecimal structure.

See Also:

explicit operator float

This method returns the float representation of the OracleDecimal value.

Declaration
// C#
public static explicit operator float(OracleDecimal val);
Parameters
Return Value

A float.

Exceptions

OracleNullValueException - The OracleDecimal has a null value.

OverFlowException - The float cannot represent the supplied OracleDecimal structure.

See Also:

OracleDecimal Properties

The OracleDecimal properties are listed in Table 5-46.

Table 5-46 OracleDecimal Properties  
Properties Description

BinData

Returns a byte array that represents the Oracle NUMBER in Oracle internal format

Format

Specifies the format for ToString()

IsInt

Indicates whether the current instance is an integer

IsNull

Indicates whether the current instance has a null value

IsPositive

Indicates whether the current instance is greater than 0

IsZero

Indicates whether the current instance has a zero value

Value

Returns a decimal value

See Also:

BinData

This property returns a byte array that represents the Oracle NUMBER in an internal Oracle format.

Declaration
// C#
public byte[] BinData {get;}
Property Value

A byte array that represents the Oracle NUMBER in an internal Oracle format.

Exceptions

OracleNullValueException - The current instance has a null value.

See Also:

Format

This property specifies the format for ToString().

Declaration
// C#
public string Format {get; set;}
Property Value

The string which specifies the format.

Remarks

Format is used when ToString() is called on an instance of an OracleDecimal. It is useful if the ToString() method needs a specific currency symbol, group, or decimal separator as part of a string.

By default, this property is null which indicates that no special formatting is used.

The decimal and group separator characters are specified by the thread's OracleGlobalization.NumericCharacters.

The currency symbols are specified by the following thread properties:

IsInt

This property indicates whether the current instance is an integer value.

Declaration
// C#
public bool IsInt {get;}
Property Value

A bool value that returns true if the current instance is an integer value; otherwise, returns false.

Exceptions

OracleNullValueException - The current instance has a null value.

See Also:

IsNull

This property indicates whether the current instance has a null value.

Declaration
// C#
public bool IsNull {get;}
Property Value

A bool value that returns true if the current instance has a null value; otherwise, returns false.

See Also:

IsPositive

This property indicates whether the value of the current instance is greater than 0.

Declaration
// C#
public bool IsPositive {get;}
Property Value

A bool value that returns true if the current instance is greater than 0; otherwise, returns false.

Exceptions

OracleNullValueException - The current instance has a null value.

See Also:

IsZero

This property indicates whether the current instance has a zero value.

Declaration
// C#
public  bool IsZero{get;}
Property Value

A bool value that returns true if the current instance has a zero value; otherwise, returns false.

Exceptions

OracleNullValueException - The current instance has a null value.

See Also:

Value

This method returns a decimal value.

Declaration
// C#
public decimal Value {get;}
Property Value

A decimal value.

Exceptions

OracleNullValueException - The current instance has a null value.

OverFlowException - The decimal cannot represent the supplied OracleDecimal structure.

Remarks

Precision can be lost when the decimal value is obtained from an OracleDecimal. See Remarks under "OracleDecimal Structure" for further information.

See Also:

OracleDecimal Instance Methods

The OracleDecimal instance methods are listed in Table 5-47.

Table 5-47 OracleDecimal Instance Methods  
Method Description

CompareTo

Compares the current instance to the supplied object and returns an integer that represents their relative values

Equals

Determines whether an object is an instance of OracleDecimal, and whether the value of the object is equal to the current instance (Overloaded)

GetHashCode

Returns a hash code for the current instance

GetType

Inherited from Object

ToByte

Returns the byte representation of the current instance

ToDouble

Returns the double representation of the current instance

ToInt16

Returns the Int16 representation of the current instance

ToInt32

Returns the Int32 representation of the current instance

ToInt64

Returns the Int64 representation of the current instance

ToSingle

Returns the Single representation of the current instance

ToString

Overloads Object.ToString()

Returns the string representation of the current instance

See Also:

CompareTo

This method compares the current instance to the supplied object and returns an integer that represents their relative values.

Declaration
// C#
public int CompareTo(object obj);
Parameters
Return Value

The method returns a number:

Implements

IComparable

Exceptions

ArgumentException - The parameter is not of type OracleDecimal.

Remarks

The following rules apply to the behavior of this method.

Equals

Overrides Object

This method determines whether an object is an instance of OracleDecimal, and whether the value of the object is equal to the current instance.

Declaration
// C#
public override bool Equals(object obj);
Parameters
Return Value

Returns true if obj is an instance of OracleDecimal, and the value of obj is equal to the current instance; otherwise, returns false.

Remarks

The following rules apply to the behavior of this method.

GetHashCode

Overrides Object

This method returns a hash code for the current instance.

Declaration
// C#
public override int GetHashCode();
Return Value

Returns a hash code.

See Also:

ToByte

This method returns the byte representation of the current instance.

Declaration
// C#
public byte ToByte();
Return Value

A byte.

Exceptions

OverFlowException - The byte cannot represent the current instance.

OracleNullValueException - The current instance has a null value.

See Also:

ToDouble

This method returns the double representation of the current instance.

Declaration
// C#
public double ToDouble();
Return Value

A double.

Exceptions

OverFlowException - The double cannot represent the current instance.

OracleNullValueException - The current instance has a null value.

See Also:

ToInt16

This method returns the Int16 representation of the current instance.

Declaration
// C#
public short ToInt16();
Return Value

A short.

Exceptions

OverFlowException - The short cannot represent the current instance.

OracleNullValueException - The current instance has a null value.

See Also:

ToInt32

This method returns the Int32 representation of the current instance.

Declaration
// C#
public int ToInt32();
Return Value

An int.

Exceptions

OverFlowException - The int cannot represent the current instance.

OracleNullValueException - The current instance has a null value.

See Also:

ToInt64

This method returns the Int64 representation of the current instance.

Declaration
// C#
public long ToInt64();
Return Value

A long.

Exceptions

OverFlowException - The long cannot represent the current instance.

OracleNullValueException - The current instance has a null value.

See Also:

ToSingle

This method returns the Single representation of the current instance.

Declaration
// C#
public float ToSingle();
Return Value

A float.

Exceptions

OverFlowException - The float cannot represent the current instance.

OracleNullValueException - The current instance has a null value.

See Also:

ToString

Overrides Object

This method returns the string representation of the current instance.

Declaration
// C#
public override string ToString();
Return Value

Returns the number in a string.

Remarks

If the current instance has a null value, the returned string is "null".

The returned value is a string representation of an OracleDecimal in the numeric format specified by the Format property.

The decimal and group separator characters are specified by the thread's OracleGlobalization.NumericCharacters.

The currency symbols are specified by the following thread properties:

If the numeric format is not specified, an Oracle default value is used.

See Also:


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 2002, 2003 Oracle Corporation.

All Rights Reserved.
Go To Table Of Contents
Contents
Go To Index
Index