52 DecimalMantissa mantissa = 0,
53 DecimalExponent exponent = 0);
58 explicit Decimal(Double value,
size_t precision = 17);
61 DecimalMantissa mantissa()
const;
64 void mantissa(DecimalMantissa);
67 DecimalExponent exponent()
const;
70 void exponent(DecimalExponent);
79 bool operator < (
const Decimal &)
const;
82 bool operator > (
const Decimal &)
const;
87 operator Int32()
const;
97 operator Int64()
const;
112 bool toNumber(Int32 &)
const;
117 bool toNumber(UInt32 &)
const;
122 bool toNumber(Int64 &)
const;
127 bool toNumber(UInt64 &)
const;
131 bool toNumber(Double &)
const;
134 void toString(std::string &)
const;
137 std::string toString()
const;
159 DecimalMantissa mantissa_;
162 DecimalExponent exponent_;
169 DecimalMantissa mantissa,
170 DecimalExponent exponent)
171 : mantissa_(mantissa),
186 DecimalMantissa value)
201 DecimalExponent value)
214 throw std::domain_error(
215 "Cannot cast value to target type. ");
226 throw std::domain_error(
227 "Cannot cast value to target type. ");
238 throw std::domain_error(
239 "Cannot cast value to target type. ");
250 throw std::domain_error(
251 "Cannot cast value to target type. ");
262 throw std::domain_error(
263 "Cannot cast value to target type. ");
270 std::string presentation;
ONIXS_FIXENGINE_API std::ostream & operator<<(std::ostream &os, const Group &group)
Stream output.
#define ONIXS_FIXENGINE_API
bool toNumber(Int32 &) const
Casts to the whole integer number as a regular floating point value is casted.
std::string toString() const
Returns the text presentation of the decimal.
DecimalMantissa mantissa() const
Returns the mantissa part of the decimal.
static bool tryParse(const char *buffer, size_t bufferSize, Decimal &)
Attempts to parse the decimal value from its string/text presentation.
unsigned long long UInt64
bool operator==(const FieldValueRef &ref, const std::string &str)
DecimalExponent exponent() const
Returns the exponent part of the decimal.
The Decimal type for a better precision.
Decimal(DecimalMantissa mantissa=0, DecimalExponent exponent=0)
Initializes an instance from compound components.
short unsigned int UInt16
The helper class for the conversion from a string to a number.
bool operator!=(const FieldValueRef &ref, const std::string &str)