Public Types

typedef Detail::decimal_number_type number_type
 An alias for Detail::decimal_number_type. More...
 

Public Member Functions

 Decimal ()
 Constructs an intsance that represents 0. More...
 
 Decimal (std::int8_t i)
 
 Decimal (std::int16_t i)
 
 Decimal (std::int32_t i)
 
 Decimal (std::int64_t i)
 
 Decimal (std::uint8_t i)
 
 Decimal (std::uint16_t i)
 
 Decimal (std::uint32_t i)
 
 Decimal (std::uint64_t i)
 
 Decimal (float f)
 
 Decimal (double d)
 
 Decimal (const std::string &str)
 Constructs an instance that represents a value whose string representation is specified as an instance of std::string class. More...
 
 Decimal (int32_t lo, int32_t mid, int32_t hi, bool isNegative, uint8_t scale)
 
 Decimal (const Decimal &d)
 
 Decimal (ArrayPtr< int32_t > bits)
 
 Decimal (std::nullptr_t bits)
 Always throws ArgumentNullException. More...
 
 ~Decimal ()
 Destructor. More...
 
Decimaloperator= (const Decimal &d)
 
 operator float () const
 Converts the value represented by the current object to single-precision floating-point value. More...
 
 operator double () const
 Converts the value represented by the current object to double-precision floating-point value. More...
 
 operator bool () const
 
Decimal operator+ (const Decimal &d) const
 
Decimal operator- (const Decimal &d) const
 
Decimal operator* (const Decimal &d) const
 
Decimal operator/ (const Decimal &d) const
 
Decimal operator% (const Decimal &d) const
 
Decimal operator- () const
 Returns a new instance of Decimal class that represents a value that results from negation of the value represented by the current object. More...
 
bool operator== (const Decimal &d) const
 
bool operator!= (const Decimal &d) const
 
bool operator== (std::nullptr_t) const
 
bool operator!= (std::nullptr_t) const
 
bool operator< (const Decimal &d) const
 
bool operator<= (const Decimal &d) const
 
bool operator> (const Decimal &d) const
 
bool operator>= (const Decimal &d) const
 
Decimaloperator++ ()
 
Decimaloperator-- ()
 
Decimaloperator+= (const Decimal &d)
 
Decimaloperator-= (const Decimal &d)
 
Decimaloperator*= (const Decimal &d)
 
Decimaloperator/= (const Decimal &d)
 
Decimaloperator%= (const Decimal &d)
 
bool Equals (const Decimal &d) const
 
bool Equals (const SharedPtr< Object > &obj) const
 
int CompareTo (const Decimal &d) const
 
int GetHashCode () const
 Returns a hash code for the current object. More...
 
String ToString () const
 Returns the string representation of the value represented by the object. More...
 
String ToString (const SharedPtr< IFormatProvider > &provider) const
 
String ToString (const SharedPtr< Globalization::CultureInfo > &culture) const
 
String ToString (const SharedPtr< Globalization::NumberFormatInfo > &nfi) const
 
String ToString (const Decimal &value, std::nullptr_t) const
 
String ToString (const String &format, const SharedPtr< IFormatProvider > &provider) const
 
String ToString (const String &format, const SharedPtr< Globalization::CultureInfo > &culture) const
 
String ToString (const String &format, const SharedPtr< Globalization::NumberFormatInfo > &nfi) const
 
String ToString (const String &format, std::nullptr_t=nullptr) const
 
std::string ToStdString () const
 Returns an instance of std::string that contains the string representation of the value represented by the object. More...
 
 Decimal (const number_type &value)
 
TypeCode GetTypeCode () const
 Gets object type code. More...
 
String ToStringInternal () const
 Returns the string representation of the value represented by the object. For internal use. More...
 

Static Public Member Functions

static Decimal Round (Decimal d, MidpointRounding mode=MidpointRounding::ToEven)
 
static Decimal Round (Decimal d, int digits, MidpointRounding mode=MidpointRounding::ToEven)
 
static Decimal Truncate (Decimal d)
 
static Decimal Ceiling (Decimal d)
 
static Decimal Floor (Decimal d)
 
static bool Equals (Decimal d1, Decimal d2)
 
static int Compare (Decimal d1, Decimal d2)
 
static Decimal Parse (const String &s)
 
static Decimal Parse (const String &s, Globalization::NumberStyles styles)
 
static Decimal Parse (const String &s, const SharedPtr< IFormatProvider > &provider)
 
static Decimal Parse (const String &s, Globalization::NumberStyles styles, const SharedPtr< IFormatProvider > &provider)
 
static bool TryParse (const String &value, Decimal &result)
 
static bool TryParse (const String &value, Globalization::NumberStyles styles, const SharedPtr< IFormatProvider > &provider, Decimal &result)
 
static const TypeInfoType ()
 Returns a reference to the TypeInfo object representing the Decimal class' type information. More...
 
static System::ArrayPtr< int > GetBits (Decimal d)
 
static void GetBytes (Decimal value, const System::ArrayPtr< uint8_t > &buffer)
 
static int64_t ToOACurrency (Decimal value)
 
static Decimal FromOACurrency (int64_t currency)
 
static Decimal Add (Decimal d1, Decimal d2)
 
static Decimal Subtract (Decimal d1, Decimal d2)
 
static Decimal Divide (Decimal d1, Decimal d2)
 
static Decimal Remainder (Decimal d1, Decimal d2)
 
static Decimal Multiply (Decimal d1, Decimal d2)
 
static Decimal Negate (Decimal d)
 Returns a new instance of Decimal class that represents a value that results from negation of the value represented by the specified object. More...
 
static uint8_t ToByte (Decimal value)
 Converts the Decimal value to unsigned 8-bit integer value. More...
 
static int8_t ToSByte (Decimal value)
 Converts the Decimal value to signed 8-bit integer value. More...
 
static uint16_t ToUInt16 (Decimal value)
 Converts the Decimal value to unsigned 16-bit integer value. More...
 
static int16_t ToInt16 (Decimal value)
 Converts the Decimal value to signed 16-bit integer value. More...
 
static uint32_t ToUInt32 (Decimal value)
 Converts the Decimal value to unsigned 32-bit integer value. More...
 
static int32_t ToInt32 (Decimal value)
 Converts the Decimal value to signed 32-bit integer value. More...
 
static uint64_t ToUInt64 (Decimal value)
 Converts the Decimal value to unsigned 64-bit integer value. More...
 
static int64_t ToInt64 (Decimal value)
 Converts the Decimal value to signed 64-bit integer value. More...
 
static float ToSingle (Decimal value)
 Converts the Decimal value to single precision floating-point number. More...
 
static double ToDouble (Decimal value)
 Converts the Decimal value to double precision floating-point number. More...
 

Static Public Attributes

static const Decimal MaxValue
 Represents the largest number that can be represented by Decimal class. More...
 
static const Decimal MinValue
 Represents the smallest number that can be represented by Decimal class. More...
 
static const Decimal MinusOne
 Represents number -1. More...
 
static const Decimal One
 Represets number 1. More...
 
static const Decimal Zero
 Represents number 0. More...
 

Static Protected Member Functions

static void DecimalToDotNetImpl (Decimal value, DecimalDotNetImpl *impl)
 

Detailed Description

Represents a decimal number. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.

Member Typedef Documentation

◆ number_type

typedef Detail::decimal_number_type System::Decimal::number_type

An alias for Detail::decimal_number_type.

Constructor & Destructor Documentation

◆ Decimal() [1/17]

System::Decimal::Decimal ( )

Constructs an intsance that represents 0.

◆ Decimal() [2/17]

System::Decimal::Decimal ( std::int8_t  i)

Consstructs an instance that represents the specified value.

Parameters
i8-bit integer value to be represented by the Decimal object being constructed

◆ Decimal() [3/17]

System::Decimal::Decimal ( std::int16_t  i)

Consstructs an instance that represents the specified value.

Parameters
i16-bit integer value to be represented by the Decimal object being constructed

◆ Decimal() [4/17]

System::Decimal::Decimal ( std::int32_t  i)

Consstructs an instance that represents the specified value.

Parameters
i32-bit integer value to be represented by the Decimal object being constructed

◆ Decimal() [5/17]

System::Decimal::Decimal ( std::int64_t  i)

Consstructs an instance that represents the specified value.

Parameters
i64-bit integer value to be represented by the Decimal object being constructed

◆ Decimal() [6/17]

System::Decimal::Decimal ( std::uint8_t  i)

Consstructs an instance that represents the specified value.

Parameters
iunsigned 8-bit integer value to be represented by the Decimal object being constructed

◆ Decimal() [7/17]

System::Decimal::Decimal ( std::uint16_t  i)

Consstructs an instance that represents the specified value.

Parameters
iunsigned 16-bit integer value to be represented by the Decimal object being constructed

◆ Decimal() [8/17]

System::Decimal::Decimal ( std::uint32_t  i)

Consstructs an instance that represents the specified value.

Parameters
iunsigned 32-bit integer value to be represented by the Decimal object being constructed

◆ Decimal() [9/17]

System::Decimal::Decimal ( std::uint64_t  i)

Consstructs an instance that represents the specified value.

Parameters
iunsigned 64-bit integer value to be represented by the Decimal object being constructed

◆ Decimal() [10/17]

System::Decimal::Decimal ( float  f)

Consstructs an instance that represents the specified value.

Parameters
fThe single-precision floating-point value to be represented by the Decimal object being constructed

◆ Decimal() [11/17]

System::Decimal::Decimal ( double  d)

Consstructs an instance that represents the specified value.

Parameters
dThe double-precision floating-point value to be represented by the Decimal object being constructed

◆ Decimal() [12/17]

System::Decimal::Decimal ( const std::string &  str)
explicit

Constructs an instance that represents a value whose string representation is specified as an instance of std::string class.

◆ Decimal() [13/17]

System::Decimal::Decimal ( int32_t  lo,
int32_t  mid,
int32_t  hi,
bool  isNegative,
uint8_t  scale 
)

Constructs a Decimal object from the specified from the specified components.

Parameters
loThe low 32 bits of the value
midThe middel 32 bits of the value
hiThe high 32 bits of the value
isNegativeSpecifies if the value is negative
scaleA power of 10 ranging from 0 to 28

◆ Decimal() [14/17]

System::Decimal::Decimal ( const Decimal d)

Constructs an instance of Decimal class that represents the same number as the specified Decimal object.

Parameters
dA Decimal object to copy the value from

◆ Decimal() [15/17]

System::Decimal::Decimal ( ArrayPtr< int32_t >  bits)

Constructs an instance of Decimal class from integer array containing a binary representation.

Parameters
bitsA integer array containing a binary representation.

◆ Decimal() [16/17]

System::Decimal::Decimal ( std::nullptr_t  bits)

Always throws ArgumentNullException.

◆ ~Decimal()

System::Decimal::~Decimal ( )

Destructor.

◆ Decimal() [17/17]

System::Decimal::Decimal ( const number_type value)

Constructs an instance of Decimal class representing the specified value.

Parameters
valueA constant reference to the value to be represented by the object being constructed

Member Function Documentation

◆ Add()

static Decimal System::Decimal::Add ( Decimal  d1,
Decimal  d2 
)
inlinestatic

Adds two specified Decimal values.

Parameters
d1First value.
d2Decond value.
Returns
The sum of d1 and d2.

◆ Ceiling()

static Decimal System::Decimal::Ceiling ( Decimal  d)
static

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

Parameters
dA decimal number
Returns
The smallest integral value that is greater than or equal to d

◆ Compare()

static int System::Decimal::Compare ( Decimal  d1,
Decimal  d2 
)
inlinestatic

Determines if the value represented by the first Decimal object is less than, equal to or greater than the value represented by the second Decimal object.

Parameters
d1The first comparand
d2The second comparand
Returns
-1 if the value represented by d1 is less than the value represented by d2; 0 if the values are equal; 1 if the value represented by d1 is greater than the value represented by d2

◆ CompareTo()

int System::Decimal::CompareTo ( const Decimal d) const

Determines if the value represented by the current object is less than, equal to or greater than the value represented by the specified object.

Parameters
dThe comparand
Returns
-1 if the value represented by the current object is less than the value represented by d; 0 if the values are equal; 1 if the value represented by the current object is greater than the value represented by d

◆ DecimalToDotNetImpl()

static void System::Decimal::DecimalToDotNetImpl ( Decimal  value,
DecimalDotNetImpl *  impl 
)
staticprotected

Converts Decimal value to equivalent C#-styled representation.

Parameters
valueInput value.
implPointer to output variable.

◆ Divide()

static Decimal System::Decimal::Divide ( Decimal  d1,
Decimal  d2 
)
inlinestatic

Divides two specified Decimal values.

Parameters
d1The dividend.
d2The divisor.
Returns
The result of dividing d1 by d2.

◆ Equals() [1/3]

bool System::Decimal::Equals ( const Decimal d) const

Determines if the values represented by the current object and the specified object are equal.

Parameters
dThe Decimal object to compare the current object with
Returns
True if the value represented by the current and the specified objects are equal, otherwise - false

◆ Equals() [2/3]

bool System::Decimal::Equals ( const SharedPtr< Object > &  obj) const

Determines if the values represented by the current object and the specified object are equal.

Parameters
objThe object to compare the current object with
Returns
True if the value represented by the current and the specified objects are equal, otherwise - false

◆ Equals() [3/3]

static bool System::Decimal::Equals ( Decimal  d1,
Decimal  d2 
)
inlinestatic

Determines if the values represented by the specified objects are equal.

Parameters
d1The first comparand
d2The second comparand
Returns
True if the values represented by d1 and d2 are equal, otherwise - false

◆ Floor()

static Decimal System::Decimal::Floor ( Decimal  d)
static

Returns the largest integral value that is less than or equal to the specified value.

Parameters
dA decimal number
Returns
The largest integral value that is less than or equal to d

◆ FromOACurrency()

static Decimal System::Decimal::FromOACurrency ( int64_t  currency)
static

Convert the specified OLE currency value to the equivalent Decimal value. NOT IMPLEMENTED.

◆ GetBits()

static System::ArrayPtr<int> System::Decimal::GetBits ( Decimal  d)
static

Converts the specified Decimal object into the binary representation of the value it represents.

Parameters
dThe Decimal object to convert
Returns
An array whos elements represent distinct bits of the binary representation of the value represented by d

◆ GetBytes()

static void System::Decimal::GetBytes ( Decimal  value,
const System::ArrayPtr< uint8_t > &  buffer 
)
static

Convert the specified Decimal value to an array of bytes.

Parameters
valueThe Decimal value to convert
bufferThe output parameter that, if the conversion succeeds, contains the result of conversion when the method returns.

◆ GetHashCode()

int System::Decimal::GetHashCode ( ) const

Returns a hash code for the current object.

◆ GetTypeCode()

TypeCode System::Decimal::GetTypeCode ( ) const
inline

Gets object type code.

◆ Multiply()

static Decimal System::Decimal::Multiply ( Decimal  d1,
Decimal  d2 
)
inlinestatic

Multiplies two specified Decimal values.

Parameters
d1The multiplicand.
d2The multiplier.
Returns
The result of multiplying d1 and d2.

◆ Negate()

static Decimal System::Decimal::Negate ( Decimal  d)
inlinestatic

Returns a new instance of Decimal class that represents a value that results from negation of the value represented by the specified object.

◆ operator bool()

System::Decimal::operator bool ( ) const
explicit

Converts the value represented by the current object to a boolean value.

Returns
True if the value represented by the current object is not 0, otherwise - false

◆ operator double()

System::Decimal::operator double ( ) const
explicit

Converts the value represented by the current object to double-precision floating-point value.

◆ operator float()

System::Decimal::operator float ( ) const
explicit

Converts the value represented by the current object to single-precision floating-point value.

◆ operator!=() [1/2]

bool System::Decimal::operator!= ( const Decimal d) const

Determines if the values represented by the current object and the specified object are not equal.

Parameters
dThe Decimal object to compare the current object with
Returns
True if the value represented by the current and the specified objects are not equal, otherwise - false

◆ operator!=() [2/2]

bool System::Decimal::operator!= ( std::nullptr_t  ) const

Determines if the value represented by the current object is different from 0.

Returns
True if the value represented by the current object is different from 0, otherwise - false

◆ operator%()

Decimal System::Decimal::operator% ( const Decimal d) const

Returns a new instance of Decimal class that represents a value that is a result of modulo operation with the values represented by the curent and the specified objects.

Parameters
dThe Decimal object representing the divisor
Returns
A new instance of Decimal class that represents a value that is a result of modulo operation with the values represented by the curent and the specified objects.

◆ operator%=()

Decimal& System::Decimal::operator%= ( const Decimal d)

Assigns to the current object a new value that is the result of modulo operation with the values represented by the curent and the specified objects.

Parameters
dThe Decimal object representing the divisor
Returns
A reference to the self

◆ operator*()

Decimal System::Decimal::operator* ( const Decimal d) const

Returns a new instance of Decimal class that represents a value that is a result of multiplication of values represented by the current and specified objects.

Parameters
dThe Decimal object representing the multiplier
Returns
A new instance of Decimal class that represents a value that is a result of multiplication of values represented by the current and specified objects

◆ operator*=()

Decimal& System::Decimal::operator*= ( const Decimal d)

Assigns to the current object a new value that is the result of multiplication of values represented by the current and specified objects.

Parameters
dThe Decimal object representing the multiplier
Returns
A reference to the self

◆ operator+()

Decimal System::Decimal::operator+ ( const Decimal d) const

Returns a new instance of Decimal class that represents a value that is a sum of values represented by the current and specified objects.

Parameters
dThe Decimal object representing the value to add
Returns
A new instance of Decimal class that represents a value that is a sum of values represented by the current and specified objects

◆ operator++()

Decimal& System::Decimal::operator++ ( )

Increments the value represented by the current object.

Returns
The reference to the self

◆ operator+=()

Decimal& System::Decimal::operator+= ( const Decimal d)

Assigns to the current object a new value that is a sum of values represented by the current and specified objects.

Parameters
dThe Decimal object representing the value to add
Returns
A reference to the self

◆ operator-() [1/2]

Decimal System::Decimal::operator- ( const Decimal d) const

Returns a new instance of Decimal class that represents a value that is the result of subtraction of the value represented by the specified object from the value represented by the current object.

Parameters
dThe Decimal object representing the value to subtract
Returns
A new instance of Decimal class that represents a value that is the result of subtraction of the value represented by the specified object from the value represented by the current object

◆ operator-() [2/2]

Decimal System::Decimal::operator- ( ) const

Returns a new instance of Decimal class that represents a value that results from negation of the value represented by the current object.

◆ operator--()

Decimal& System::Decimal::operator-- ( )

Decrements the value represented by the current object.

Returns
The reference to the self

◆ operator-=()

Decimal& System::Decimal::operator-= ( const Decimal d)

Assigns to the current object a new value that is the result of subtraction of the value represented by the specified object from the value represented by the current object.

Parameters
dThe Decimal object representing the value to subtract
Returns
A reference to the self

◆ operator/()

Decimal System::Decimal::operator/ ( const Decimal d) const

Returns a new instance of Decimal class that represents a value that is a result of division of the value represented by the current object by the value represented by the specified object.

Parameters
dThe Decimal object representing the divisor
Returns
A new instance of Decimal class that represents a value that is a result of division of the value represented by the current object by the value represented by the specified object.

◆ operator/=()

Decimal& System::Decimal::operator/= ( const Decimal d)

Assigns to the current object a new value that is the result of division of the value represented by the current object by the value represented by the specified object.

Parameters
dThe Decimal object representing the divisor
Returns
A reference to the self

◆ operator<>

bool System::Decimal::operator< ( const Decimal d) const

Determines if the value represented by the current object is less than the value represented by the specified object.

Parameters
dThe Decimal object to compare the current object with
Returns
True if the value represented by the current object is less than the value represented by d, otherwise - false

◆ operator<>

bool System::Decimal::operator<= ( const Decimal d) const

Determines if the value represented by the current object is less than or equal to the value represented by the specified object.

Parameters
dThe Decimal object to compare the current object with
Returns
True if the value represented by the current object is less than or equal to the value represented by d, otherwise - false

◆ operator=()

Decimal& System::Decimal::operator= ( const Decimal d)

Assigns the value represented by the specified object to the current object.

Parameters
dDecimal object to copy the value from
Returns
The reference to the self

◆ operator==() [1/2]

bool System::Decimal::operator== ( const Decimal d) const

Determines if the values represented by the current object and the specified object are equal.

Parameters
dThe Decimal object to compare the current object with
Returns
True if the value represented by the current and the specified objects are equal, otherwise - false

◆ operator==() [2/2]

bool System::Decimal::operator== ( std::nullptr_t  ) const

Determines if the value represented by the current object is 0.

Returns
True if the value represented by the current object is 0, otherwise - false

◆ operator>()

bool System::Decimal::operator> ( const Decimal d) const

Determines if the value represented by the current object is greater than the value represented by the specified object.

Parameters
dThe Decimal object to compare the current object with
Returns
True if the value represented by the current object is greater than the value represented by d, otherwise - false

◆ operator>=()

bool System::Decimal::operator>= ( const Decimal d) const

Determines if the value represented by the current object is greater than or equal to the value represented by the specified object.

Parameters
dThe Decimal object to compare the current object with
Returns
True if the value represented by the current object is greater than or equal to the value represented by d, otherwise - false

◆ Parse() [1/4]

static Decimal System::Decimal::Parse ( const String s)
static

Converts the string representation of a decimal number into an equivalent instance of Decimal class.

Parameters
sThe string representation of a number
Returns
A new instance of Decimal class repsenting a value equivalent to that represented by the specified string.

◆ Parse() [2/4]

static Decimal System::Decimal::Parse ( const String s,
Globalization::NumberStyles  styles 
)
static

Converts the string representation of a decimal number into an equivalent instance of Decimal class using the specified style.

Parameters
sThe string representation of a decimal value to convert
stylesA bitwise combination of the enumeration values that provides additional information about s, about style elements that may be present in s, or about the conversion from s to a Decimal object
Returns
A new instance of Decimal class repsenting a value equivalent to that represented by the specified string

◆ Parse() [3/4]

static Decimal System::Decimal::Parse ( const String s,
const SharedPtr< IFormatProvider > &  provider 
)
static

Converts the string representation of a decimal number into an equivalent instance of Decimal class using the specified format provider.

Parameters
sThe string representation of a decimal value to convert
providerFormat provider
Returns
A new instance of Decimal class repsenting a value equivalent to that represented by the specified string

◆ Parse() [4/4]

static Decimal System::Decimal::Parse ( const String s,
Globalization::NumberStyles  styles,
const SharedPtr< IFormatProvider > &  provider 
)
static

Converts the string representation of a decimal number into an equivalent instance of Decimal class using the specified style and format provider.

Parameters
sThe string representation of a decimal value to convert
stylesA bitwise combination of the enumeration values that provides additional information about s, about style elements that may be present in s, or about the conversion from s to a Decimal object
providerFormat provider
Returns
A new instance of Decimal class repsenting a value equivalent to that represented by the specified string

◆ Remainder()

static Decimal System::Decimal::Remainder ( Decimal  d1,
Decimal  d2 
)
inlinestatic

Computes the remainder after dividing two Decimal values.

Parameters
d1The dividend.
d2The divisor.
Returns
The remainder after dividing d1 by d2.

◆ Round() [1/2]

static Decimal System::Decimal::Round ( Decimal  d,
MidpointRounding  mode = MidpointRounding::ToEven 
)
static

Rounds the specified value to the nearest integral number. A parameter specifies the function's behavior if the specified value is equally close to two nearest numbers.

Parameters
dThe value to round
modeSpecifies how to perform the rounding if value is equally close to two nearest numbers.
Returns
d rounded to the nearest integral value

◆ Round() [2/2]

static Decimal System::Decimal::Round ( Decimal  d,
int  digits,
MidpointRounding  mode = MidpointRounding::ToEven 
)
static

Rounds the specified value to the nearest value with the specified number of fractional digits. A parameter specifies the function's behavior if the specified value is equally close to two nearest numbers.

Parameters
dThe value to round
digitsThe number of fractional digits in the rounded value
modeSpecifies how to perform the rounding if value is equally close to two nearest numbers.
Returns
The number with the specified number of digits nearest to value

◆ Subtract()

static Decimal System::Decimal::Subtract ( Decimal  d1,
Decimal  d2 
)
inlinestatic

Subtracts one specified Decimal value from another.

Parameters
d1The minuend.
d2The subtrahend.
Returns
The result of subtracting d2 from d1.

◆ ToByte()

static uint8_t System::Decimal::ToByte ( Decimal  value)
inlinestatic

Converts the Decimal value to unsigned 8-bit integer value.

◆ ToDouble()

static double System::Decimal::ToDouble ( Decimal  value)
inlinestatic

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

◆ ToInt16()

static int16_t System::Decimal::ToInt16 ( Decimal  value)
inlinestatic

Converts the Decimal value to signed 16-bit integer value.

◆ ToInt32()

static int32_t System::Decimal::ToInt32 ( Decimal  value)
inlinestatic

Converts the Decimal value to signed 32-bit integer value.

◆ ToInt64()

static int64_t System::Decimal::ToInt64 ( Decimal  value)
inlinestatic

Converts the Decimal value to signed 64-bit integer value.

◆ ToOACurrency()

static int64_t System::Decimal::ToOACurrency ( Decimal  value)
static

Convert the specified Decimal value to the equivalent OLE currency value. NOT IMPLEMENTED.

◆ ToSByte()

static int8_t System::Decimal::ToSByte ( Decimal  value)
inlinestatic

Converts the Decimal value to signed 8-bit integer value.

◆ ToSingle()

static float System::Decimal::ToSingle ( Decimal  value)
inlinestatic

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

◆ ToStdString()

std::string System::Decimal::ToStdString ( ) const

Returns an instance of std::string that contains the string representation of the value represented by the object.

◆ ToString() [1/9]

String System::Decimal::ToString ( ) const

Returns the string representation of the value represented by the object.

◆ ToString() [2/9]

String System::Decimal::ToString ( const SharedPtr< IFormatProvider > &  provider) const

Converts current object to string using the culture-specific format information.

Parameters
providerThe IFormatProvider object providing the culture-specific format information.
Returns
The string representation of the current object.

◆ ToString() [3/9]

String System::Decimal::ToString ( const SharedPtr< Globalization::CultureInfo > &  culture) const

◆ ToString() [4/9]

String System::Decimal::ToString ( const SharedPtr< Globalization::NumberFormatInfo > &  nfi) const

◆ ToString() [5/9]

String System::Decimal::ToString ( const Decimal value,
std::nullptr_t   
) const
inline

◆ ToString() [6/9]

String System::Decimal::ToString ( const String format,
const SharedPtr< IFormatProvider > &  provider 
) const

Converts current object to its string representation using the specified string format and culture-specific format information provided by the specified IFormatProvider object.

Parameters
formatThe string format.
providerThe IFormatProvider object providing the culture-specific format information.
Returns
The string representation of the current object.

◆ ToString() [7/9]

String System::Decimal::ToString ( const String format,
const SharedPtr< Globalization::CultureInfo > &  culture 
) const

◆ ToString() [8/9]

String System::Decimal::ToString ( const String format,
const SharedPtr< Globalization::NumberFormatInfo > &  nfi 
) const

◆ ToString() [9/9]

String System::Decimal::ToString ( const String format,
std::nullptr_t  = nullptr 
) const

◆ ToStringInternal()

String System::Decimal::ToStringInternal ( ) const

Returns the string representation of the value represented by the object. For internal use.

◆ ToUInt16()

static uint16_t System::Decimal::ToUInt16 ( Decimal  value)
inlinestatic

Converts the Decimal value to unsigned 16-bit integer value.

◆ ToUInt32()

static uint32_t System::Decimal::ToUInt32 ( Decimal  value)
inlinestatic

Converts the Decimal value to unsigned 32-bit integer value.

◆ ToUInt64()

static uint64_t System::Decimal::ToUInt64 ( Decimal  value)
inlinestatic

Converts the Decimal value to unsigned 64-bit integer value.

◆ Truncate()

static Decimal System::Decimal::Truncate ( Decimal  d)
static

Returns the Decimal object representing a value that has integral part equal to that of the value represented by the specified Decimal object of the with all fractional digits discarded.

Parameters
dA decimal number
Returns
A Decimal object reprsenting a decimal value whose integral part is equal to that of the specified value and fractional digits are all 0.

◆ TryParse() [1/2]

static bool System::Decimal::TryParse ( const String value,
Decimal result 
)
static

Converts the specified string containing the string representation of a number to the equivalent Decimal value.

Parameters
valueThe string to convert
resultThe reference to a Decimal variable where the result of the conversion is put
Returns
True if the conversion succeeded, otherwise - false

◆ TryParse() [2/2]

static bool System::Decimal::TryParse ( const String value,
Globalization::NumberStyles  styles,
const SharedPtr< IFormatProvider > &  provider,
Decimal result 
)
static

Converts the specified string containing the string representation of a number to the equivalent Decimal value using the provided formatting information and number style.

Parameters
valueThe string to convert
stylesA bitwise combination of values of NumberStyles enum that specifies the permitted style of the string representation of a number
providerA pointer to an object that contains the string format information
resultAn output argument; contains the result of conversion
Returns
True if the conversion succeeded, otherwise - false

◆ Type()

static const TypeInfo& System::Decimal::Type ( )
inlinestatic

Returns a reference to the TypeInfo object representing the Decimal class' type information.

Member Data Documentation

◆ MaxValue

const Decimal System::Decimal::MaxValue
static

Represents the largest number that can be represented by Decimal class.

◆ MinusOne

const Decimal System::Decimal::MinusOne
static

Represents number -1.

◆ MinValue

const Decimal System::Decimal::MinValue
static

Represents the smallest number that can be represented by Decimal class.

◆ One

const Decimal System::Decimal::One
static

Represets number 1.

◆ Zero

const Decimal System::Decimal::Zero
static

Represents number 0.