Public Types | |
typedef Detail::decimal_number_type | number_type |
An alias for Detail::decimal_number_type. More... | |
Public Member Functions | |
ASPOSECPP_SHARED_API | Decimal () |
Constructs an instance that represents 0. More... | |
ASPOSECPP_SHARED_API | Decimal (std::int8_t i) |
ASPOSECPP_SHARED_API | Decimal (std::int16_t i) |
ASPOSECPP_SHARED_API | Decimal (std::int32_t i) |
ASPOSECPP_SHARED_API | Decimal (std::int64_t i) |
ASPOSECPP_SHARED_API | Decimal (std::uint8_t i) |
ASPOSECPP_SHARED_API | Decimal (std::uint16_t i) |
ASPOSECPP_SHARED_API | Decimal (std::uint32_t i) |
ASPOSECPP_SHARED_API | Decimal (std::uint64_t i) |
ASPOSECPP_SHARED_API | Decimal (float f) |
ASPOSECPP_SHARED_API | Decimal (double d) |
ASPOSECPP_SHARED_API | 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... | |
ASPOSECPP_SHARED_API | Decimal (int32_t lo, int32_t mid, int32_t hi, bool isNegative, uint8_t scale) |
ASPOSECPP_SHARED_API | Decimal (const Decimal &d) |
ASPOSECPP_SHARED_API | Decimal (const ArrayPtr< int32_t > &bits) |
ASPOSECPP_SHARED_API | Decimal (std::nullptr_t bits) |
Always throws ArgumentNullException. More... | |
ASPOSECPP_SHARED_API | ~Decimal () |
Destructor. More... | |
ASPOSECPP_SHARED_API Decimal & | operator= (const Decimal &d) |
ASPOSECPP_SHARED_API | operator float () const |
Converts the value represented by the current object to single-precision floating-point value. More... | |
ASPOSECPP_SHARED_API | operator double () const |
Converts the value represented by the current object to double-precision floating-point value. More... | |
ASPOSECPP_SHARED_API | operator bool () const |
ASPOSECPP_SHARED_API Decimal | operator+ (const Decimal &d) const |
ASPOSECPP_SHARED_API Decimal | operator- (const Decimal &d) const |
ASPOSECPP_SHARED_API Decimal | operator* (const Decimal &d) const |
ASPOSECPP_SHARED_API Decimal | operator/ (const Decimal &d) const |
ASPOSECPP_SHARED_API Decimal | operator% (const Decimal &d) const |
ASPOSECPP_SHARED_API 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... | |
ASPOSECPP_SHARED_API bool | operator== (const Decimal &d) const |
ASPOSECPP_SHARED_API bool | operator!= (const Decimal &d) const |
ASPOSECPP_SHARED_API bool | operator== (std::nullptr_t) const |
ASPOSECPP_SHARED_API bool | operator!= (std::nullptr_t) const |
ASPOSECPP_SHARED_API bool | operator< (const Decimal &d) const |
ASPOSECPP_SHARED_API bool | operator<= (const Decimal &d) const |
ASPOSECPP_SHARED_API bool | operator> (const Decimal &d) const |
ASPOSECPP_SHARED_API bool | operator>= (const Decimal &d) const |
ASPOSECPP_SHARED_API Decimal & | operator++ () |
ASPOSECPP_SHARED_API Decimal & | operator-- () |
ASPOSECPP_SHARED_API Decimal & | operator+= (const Decimal &d) |
ASPOSECPP_SHARED_API Decimal & | operator-= (const Decimal &d) |
ASPOSECPP_SHARED_API Decimal & | operator*= (const Decimal &d) |
ASPOSECPP_SHARED_API Decimal & | operator/= (const Decimal &d) |
ASPOSECPP_SHARED_API Decimal & | operator%= (const Decimal &d) |
ASPOSECPP_SHARED_API bool | Equals (const Decimal &d) const |
ASPOSECPP_SHARED_API bool | Equals (const SharedPtr< Object > &obj) const |
ASPOSECPP_SHARED_API int | CompareTo (const Decimal &d) const |
ASPOSECPP_SHARED_API int | GetHashCode () const |
Returns a hash code for the current object. More... | |
ASPOSECPP_SHARED_API String | ToString () const |
Returns the string representation of the value represented by the object. More... | |
ASPOSECPP_SHARED_API String | ToString (const SharedPtr< IFormatProvider > &provider) const |
ASPOSECPP_SHARED_API String | ToString (const SharedPtr< Globalization::CultureInfo > &culture) const |
ASPOSECPP_SHARED_API String | ToString (const SharedPtr< Globalization::NumberFormatInfo > &nfi) const |
String | ToString (const Decimal &value, std::nullptr_t) const |
ASPOSECPP_SHARED_API String | ToString (const String &format, const SharedPtr< IFormatProvider > &provider) const |
ASPOSECPP_SHARED_API String | ToString (const String &format, const SharedPtr< Globalization::CultureInfo > &culture) const |
ASPOSECPP_SHARED_API String | ToString (const String &format, const SharedPtr< Globalization::NumberFormatInfo > &nfi) const |
ASPOSECPP_SHARED_API String | ToString (const String &format, std::nullptr_t=nullptr) const |
ASPOSECPP_SHARED_API std::string | ToStdString () const |
Returns an instance of std::string that contains the string representation of the value represented by the object. More... | |
ASPOSECPP_SHARED_API | 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 ASPOSECPP_SHARED_API Decimal | Round (const Decimal &d, MidpointRounding mode=MidpointRounding::ToEven) |
static ASPOSECPP_SHARED_API Decimal | Round (const Decimal &d, int digits, MidpointRounding mode=MidpointRounding::ToEven) |
static ASPOSECPP_SHARED_API Decimal | Truncate (const Decimal &d) |
static ASPOSECPP_SHARED_API Decimal | Ceiling (const Decimal &d) |
static ASPOSECPP_SHARED_API Decimal | Floor (const Decimal &d) |
static bool | Equals (const Decimal &d1, const Decimal &d2) |
static int | Compare (const Decimal &d1, const Decimal &d2) |
static ASPOSECPP_SHARED_API Decimal | Parse (const String &s) |
static ASPOSECPP_SHARED_API Decimal | Parse (const String &s, Globalization::NumberStyles styles) |
static ASPOSECPP_SHARED_API Decimal | Parse (const String &s, const SharedPtr< IFormatProvider > &provider) |
static ASPOSECPP_SHARED_API Decimal | Parse (const String &s, Globalization::NumberStyles styles, const SharedPtr< IFormatProvider > &provider) |
static ASPOSECPP_SHARED_API bool | TryParse (const String &value, Decimal &result) |
static ASPOSECPP_SHARED_API bool | TryParse (const String &value, Globalization::NumberStyles styles, const SharedPtr< IFormatProvider > &provider, Decimal &result) |
static const TypeInfo & | Type () |
Returns a reference to the TypeInfo object representing the Decimal class' type information. More... | |
static ASPOSECPP_SHARED_API System::ArrayPtr< int > | GetBits (const Decimal &d) |
static ASPOSECPP_SHARED_API void | GetBytes (const Decimal &value, const System::ArrayPtr< uint8_t > &buffer) |
static ASPOSECPP_SHARED_API int64_t | ToOACurrency (const Decimal &value) |
static ASPOSECPP_SHARED_API Decimal | FromOACurrency (int64_t currency) |
static Decimal | Add (const Decimal &d1, const Decimal &d2) |
static Decimal | Subtract (const Decimal &d1, const Decimal &d2) |
static Decimal | Divide (const Decimal &d1, const Decimal &d2) |
static Decimal | Remainder (const Decimal &d1, const Decimal &d2) |
static Decimal | Multiply (const Decimal &d1, const Decimal &d2) |
static Decimal | Negate (const 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 ASPOSECPP_SHARED_API | MaxValue |
Represents the largest number that can be represented by Decimal class. More... | |
static const Decimal ASPOSECPP_SHARED_API | MinValue |
Represents the smallest number that can be represented by Decimal class. More... | |
static const Decimal ASPOSECPP_SHARED_API | MinusOne |
Represents number -1. More... | |
static const Decimal ASPOSECPP_SHARED_API | One |
Represents number 1. More... | |
static const Decimal ASPOSECPP_SHARED_API | Zero |
Represents number 0. More... | |
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.
typedef Detail::decimal_number_type System::Decimal::number_type |
An alias for Detail::decimal_number_type.
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | ) |
Constructs an instance that represents 0.
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | std::int8_t | i | ) |
Constructs an instance that represents the specified value.
i | 8-bit integer value to be represented by the Decimal object being constructed |
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | std::int16_t | i | ) |
Constructs an instance that represents the specified value.
i | 16-bit integer value to be represented by the Decimal object being constructed |
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | std::int32_t | i | ) |
Constructs an instance that represents the specified value.
i | 32-bit integer value to be represented by the Decimal object being constructed |
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | std::int64_t | i | ) |
Constructs an instance that represents the specified value.
i | 64-bit integer value to be represented by the Decimal object being constructed |
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | std::uint8_t | i | ) |
Constructs an instance that represents the specified value.
i | unsigned 8-bit integer value to be represented by the Decimal object being constructed |
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | std::uint16_t | i | ) |
Constructs an instance that represents the specified value.
i | unsigned 16-bit integer value to be represented by the Decimal object being constructed |
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | std::uint32_t | i | ) |
Constructs an instance that represents the specified value.
i | unsigned 32-bit integer value to be represented by the Decimal object being constructed |
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | std::uint64_t | i | ) |
Constructs an instance that represents the specified value.
i | unsigned 64-bit integer value to be represented by the Decimal object being constructed |
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | float | f | ) |
Constructs an instance that represents the specified value.
f | The single-precision floating-point value to be represented by the Decimal object being constructed |
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | double | d | ) |
Constructs an instance that represents the specified value.
d | The double-precision floating-point value to be represented by the Decimal object being constructed |
|
explicit |
Constructs an instance that represents a value whose string representation is specified as an instance of std::string class.
ASPOSECPP_SHARED_API 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.
lo | The low 32 bits of the value |
mid | The middle 32 bits of the value |
hi | The high 32 bits of the value |
isNegative | Specifies if the value is negative |
scale | A power of 10 ranging from 0 to 28 |
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | const Decimal & | d | ) |
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | const ArrayPtr< int32_t > & | bits | ) |
Constructs an instance of Decimal class from integer array containing a binary representation.
bits | A integer array containing a binary representation. |
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | std::nullptr_t | bits | ) |
Always throws ArgumentNullException.
ASPOSECPP_SHARED_API System::Decimal::~Decimal | ( | ) |
Destructor.
ASPOSECPP_SHARED_API System::Decimal::Decimal | ( | const number_type & | value | ) |
Constructs an instance of Decimal class representing the specified value.
value | A constant reference to the value to be represented by the object being constructed |
Adds two specified Decimal values.
d1 | First value. |
d2 | Second value. |
d1
and d2
. Returns the smallest integral value that is greater than or equal to the specified value.
d | A decimal number |
d
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.
d1 | The first comparand |
d2 | The second comparand |
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
ASPOSECPP_SHARED_API 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.
d | The comparand |
d
; 0 if the values are equal; 1 if the value represented by the current object is greater than the value represented by d
Divides two specified Decimal values.
d1 | The dividend. |
d2 | The divisor. |
d1
by d2
. ASPOSECPP_SHARED_API bool System::Decimal::Equals | ( | const Decimal & | d | ) | const |
Determines if the values represented by the current object and the specified object are equal.
d | The Decimal object to compare the current object with |
Determines if the values represented by the current object and the specified object are equal.
obj | The object to compare the current object with |
Determines if the values represented by the specified objects are equal.
d1 | The first comparand |
d2 | The second comparand |
d1
and d2
are equal, otherwise - false Returns the largest integral value that is less than or equal to the specified value.
d | A decimal number |
d
|
static |
|
static |
|
static |
ASPOSECPP_SHARED_API int System::Decimal::GetHashCode | ( | ) | const |
Returns a hash code for the current object.
|
inline |
Gets object type code.
Multiplies two specified Decimal values.
d1 | The multiplicand. |
d2 | The multiplier. |
d1
and d2
. Returns a new instance of Decimal class that represents a value that results from negation of the value represented by the specified object.
|
explicit |
Converts the value represented by the current object to a boolean value.
|
explicit |
Converts the value represented by the current object to double-precision floating-point value.
|
explicit |
Converts the value represented by the current object to single-precision floating-point value.
ASPOSECPP_SHARED_API bool System::Decimal::operator!= | ( | const Decimal & | d | ) | const |
Determines if the values represented by the current object and the specified object are not equal.
d | The Decimal object to compare the current object with |
ASPOSECPP_SHARED_API bool System::Decimal::operator!= | ( | std::nullptr_t | ) | const |
Determines if the value represented by the current object is different from 0.
Returns a new instance of Decimal class that represents a value that is a result of modulo operation with the values represented by the current and the specified objects.
d | The Decimal object representing the divisor |
Assigns to the current object a new value that is the result of modulo operation with the values represented by the current and the specified objects.
d | The Decimal object representing the divisor |
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.
d | The Decimal object representing the multiplier |
Assigns to the current object a new value that is the result of multiplication of values represented by the current and specified objects.
d | The Decimal object representing the multiplier |
Returns a new instance of Decimal class that represents a value that is a sum of values represented by the current and specified objects.
d | The Decimal object representing the value to add |
ASPOSECPP_SHARED_API Decimal& System::Decimal::operator++ | ( | ) |
Increments the value represented by the current object.
Assigns to the current object a new value that is a sum of values represented by the current and specified objects.
d | The Decimal object representing the value to add |
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.
d | The Decimal object representing the value to subtract |
ASPOSECPP_SHARED_API 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.
ASPOSECPP_SHARED_API Decimal& System::Decimal::operator-- | ( | ) |
Decrements the value represented by the current object.
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.
d | The Decimal object representing the value to subtract |
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.
d | The Decimal object representing the divisor |
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.
d | The Decimal object representing the divisor |
ASPOSECPP_SHARED_API 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.
d | The Decimal object to compare the current object with |
d
, otherwise - false ASPOSECPP_SHARED_API 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.
d | The Decimal object to compare the current object with |
d
, otherwise - false Assigns the value represented by the specified object to the current object.
d | Decimal object to copy the value from |
ASPOSECPP_SHARED_API bool System::Decimal::operator== | ( | const Decimal & | d | ) | const |
Determines if the values represented by the current object and the specified object are equal.
d | The Decimal object to compare the current object with |
ASPOSECPP_SHARED_API bool System::Decimal::operator== | ( | std::nullptr_t | ) | const |
Determines if the value represented by the current object is 0.
ASPOSECPP_SHARED_API 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.
d | The Decimal object to compare the current object with |
d
, otherwise - false ASPOSECPP_SHARED_API 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.
d | The Decimal object to compare the current object with |
d
, otherwise - false
|
static |
Converts the string representation of a decimal number into an equivalent instance of Decimal class using the specified style.
s | The string representation of a decimal value to convert |
styles | A 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 |
|
static |
Converts the string representation of a decimal number into an equivalent instance of Decimal class using the specified format provider.
s | The string representation of a decimal value to convert |
provider | Format provider |
|
static |
Converts the string representation of a decimal number into an equivalent instance of Decimal class using the specified style and format provider.
s | The string representation of a decimal value to convert |
styles | A 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 |
provider | Format provider |
Computes the remainder after dividing two Decimal values.
d1 | The dividend. |
d2 | The divisor. |
d1
by d2
.
|
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.
d | The value to round |
mode | Specifies how to perform the rounding if value is equally close to two nearest numbers. |
d
rounded to the nearest integral value
|
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.
d | The value to round |
digits | The number of fractional digits in the rounded value |
mode | Specifies how to perform the rounding if value is equally close to two nearest numbers. |
value
Subtracts one specified Decimal value from another.
d1 | The minuend. |
d2 | The subtrahend. |
d2
from d1
.
|
inlinestatic |
Converts the Decimal value to unsigned 8-bit integer value.
|
inlinestatic |
Converts the Decimal value to double precision floating-point number.
|
inlinestatic |
Converts the Decimal value to signed 16-bit integer value.
|
inlinestatic |
Converts the Decimal value to signed 32-bit integer value.
|
inlinestatic |
Converts the Decimal value to signed 64-bit integer value.
|
static |
|
inlinestatic |
Converts the Decimal value to signed 8-bit integer value.
|
inlinestatic |
Converts the Decimal value to single precision floating-point number.
ASPOSECPP_SHARED_API std::string System::Decimal::ToStdString | ( | ) | const |
Returns an instance of std::string that contains the string representation of the value represented by the object.
ASPOSECPP_SHARED_API String System::Decimal::ToString | ( | ) | const |
Returns the string representation of the value represented by the object.
ASPOSECPP_SHARED_API String System::Decimal::ToString | ( | const SharedPtr< IFormatProvider > & | provider | ) | const |
Converts current object to string using the culture-specific format information.
provider | The IFormatProvider object providing the culture-specific format information. |
ASPOSECPP_SHARED_API String System::Decimal::ToString | ( | const SharedPtr< Globalization::CultureInfo > & | culture | ) | const |
ASPOSECPP_SHARED_API String System::Decimal::ToString | ( | const SharedPtr< Globalization::NumberFormatInfo > & | nfi | ) | const |
ASPOSECPP_SHARED_API 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.
format | The string format. |
provider | The IFormatProvider object providing the culture-specific format information. |
ASPOSECPP_SHARED_API String System::Decimal::ToString | ( | const String & | format, |
const SharedPtr< Globalization::CultureInfo > & | culture | ||
) | const |
ASPOSECPP_SHARED_API String System::Decimal::ToString | ( | const String & | format, |
const SharedPtr< Globalization::NumberFormatInfo > & | nfi | ||
) | const |
ASPOSECPP_SHARED_API String System::Decimal::ToString | ( | const String & | format, |
std::nullptr_t | = nullptr |
||
) | const |
String System::Decimal::ToStringInternal | ( | ) | const |
Returns the string representation of the value represented by the object. For internal use.
|
inlinestatic |
Converts the Decimal value to unsigned 16-bit integer value.
|
inlinestatic |
Converts the Decimal value to unsigned 32-bit integer value.
|
inlinestatic |
Converts the Decimal value to unsigned 64-bit integer value.
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.
d | A decimal number |
|
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.
value | The string to convert |
styles | A bitwise combination of values of NumberStyles enum that specifies the permitted style of the string representation of a number |
provider | A pointer to an object that contains the string format information |
result | An output argument; contains the result of conversion |
|
inlinestatic |
|
static |
Represents the largest number that can be represented by Decimal class.
|
static |
Represents number -1.
|
static |
Represents the smallest number that can be represented by Decimal class.
|
static |
Represents number 1.
|
static |
Represents number 0.