Price system representation.
More...
|
enum | { NO_PRICE = (int)0x80000000
} |
| This value indicates that price in not set.
|
|
|
| Price () |
| Default constructor.
|
|
| Price (int priceTicks, unsigned int priceDenominator, PriceUnitPremium::Enum priceUnitPremium=PriceUnitPremium::Price) |
| Constructor.
|
|
| Price (const Price &other, unsigned int newDenominator) |
| Converts some Price value to another denominator.
|
|
bool | noPrice () const |
| Indicates if price has no value (ticks is equal to 999999999, i.e. 9 nines).
|
|
template<typename T > |
T | convertTo () const |
| Converts Price representation to needed number type. More...
|
|
void | convertToDecimal (int8 &sign, uint64 &mantissaHigh, uint64 &mantissaLow, int32 &exponent) const |
| Converts price to decimal. More...
|
|
| operator float () const |
| Implicit conversion to float number type.
|
|
| operator double () const |
| Implicit conversion to double number type.
|
|
std::string | toString () const |
| string representation of price
|
|
bool | operator== (const Price &) const |
| Price comparison.
|
|
bool | operator!= (const Price &) const |
|
bool | operator< (const Price &) const |
|
bool | operator> (const Price &) const |
|
bool | operator<= (const Price &) const |
|
bool | operator>= (const Price &) const |
|
Price system representation.
Converts Price representation to needed number type.
Target number type should have accessible constructor from int type, and should have visible operator/.
decimal price = exchangePrice.convertTo<decimal>()
void convertToDecimal |
( |
int8 & |
sign, |
|
|
uint64 & |
mantissaHigh, |
|
|
uint64 & |
mantissaLow, |
|
|
int32 & |
exponent |
|
) |
| const |
Converts price to decimal.
- Parameters
-
sign | is a sign of the price (usually 0) |
mantissaHigh | is a high part of 128 bit mantissa |
mantissaLow | is a low part of 128 bit mantissa |
exponent | is an exponent with basis 10 |