Name | |
---|---|
MamaPricePrecision(byte value, String text) | |
String | toString() |
int | precision2Decimals() |
int | precision2Denom() |
MamaPricePrecision | decimals2Precision(int places) |
MamaPricePrecision | denom2Precision(int denominator) |
class com::wombat::mama::MamaPricePrecision;
The MamaPricePrecision class determines how decimals are represented for the price. PRECISION_10 - PRECISION_10000000000 represent decimal places. PRECISION_DIV_2, _4, etc, represent fraction 1/2’s ,1/4’s etc.
TICK_32, HALF_32 are for feeds that send prices in 1/32’s and half 1/32’s.
inline MamaPricePrecision(
byte value,
String text
)
inline String toString()
inline int precision2Decimals()
Return the number of decimal places for this precision. Returns 10 for fractional precision for consistency with C API.
inline int precision2Denom()
Return the fractional denominator or 0 if the precision is not fractional.
static inline MamaPricePrecision decimals2Precision(
int places
)
Return the appropriate precision for a given number of decimal places. If places is greater than 10 return Unknown.
static inline MamaPricePrecision denom2Precision(
int denominator
)
Return the appropriate precision code for a given fractional denominator.
static final MamaPricePrecision PRECISION_UNKNOWN =
new MamaPricePrecision ((byte) 0x00, "UNKNOWN");
static final MamaPricePrecision PRECISION_10 =
new MamaPricePrecision ((byte) 0x01, "10");
static final MamaPricePrecision PRECISION_100 =
new MamaPricePrecision ((byte) 0x02, "100");
static final MamaPricePrecision PRECISION_1000 =
new MamaPricePrecision ((byte) 0x03, "1000");
static final MamaPricePrecision PRECISION_10000 =
new MamaPricePrecision ((byte) 0x04, "10000");
static final MamaPricePrecision PRECISION_100000 =
new MamaPricePrecision ((byte) 0x05, "100000");
static final MamaPricePrecision PRECISION_1000000 =
new MamaPricePrecision ((byte) 0x06, "1000000");
static final MamaPricePrecision PRECISION_10000000 =
new MamaPricePrecision ((byte) 0x07, "10000000");
static final MamaPricePrecision PRECISION_100000000 =
new MamaPricePrecision ((byte) 0x08, "100000000");
static final MamaPricePrecision PRECISION_1000000000 =
new MamaPricePrecision ((byte) 0x09, "1000000000");
static final MamaPricePrecision PRECISION_10000000000 =
new MamaPricePrecision ((byte) 0x0a, "10000000000");
static final MamaPricePrecision PRECISION_100000000000 =
new MamaPricePrecision ((byte) 0x0b, "100000000000");
static final MamaPricePrecision PRECISION_1000000000000 =
new MamaPricePrecision ((byte) 0x0c, "1000000000000");
static final MamaPricePrecision PRECISION_10000000000000 =
new MamaPricePrecision ((byte) 0x0d, "10000000000000");
static final MamaPricePrecision PRECISION_100000000000000 =
new MamaPricePrecision ((byte) 0x0e, "100000000000000");
static final MamaPricePrecision PRECISION_1000000000000000 =
new MamaPricePrecision ((byte) 0x0f, "1000000000000000");
static final MamaPricePrecision PRECISION_INT =
new MamaPricePrecision ((byte) 0x10, "INT");
static final MamaPricePrecision PRECISION_DIV_2 =
new MamaPricePrecision ((byte) 0x11, "2");
static final MamaPricePrecision PRECISION_DIV_4 =
new MamaPricePrecision ((byte) 0x12, "4");
static final MamaPricePrecision PRECISION_DIV_8 =
new MamaPricePrecision ((byte) 0x13, "8");
static final MamaPricePrecision PRECISION_DIV_16 =
new MamaPricePrecision ((byte) 0x14, "16");
static final MamaPricePrecision PRECISION_DIV_32 =
new MamaPricePrecision ((byte) 0x15, "32");
static final MamaPricePrecision PRECISION_DIV_64 =
new MamaPricePrecision ((byte) 0x16, "64");
static final MamaPricePrecision PRECISION_DIV_128 =
new MamaPricePrecision ((byte) 0x17, "128");
static final MamaPricePrecision PRECISION_DIV_256 =
new MamaPricePrecision ((byte) 0x18, "256");
static final MamaPricePrecision PRECISION_DIV_512 =
new MamaPricePrecision ((byte) 0x19, "512");
static final MamaPricePrecision PRECISION_TICK_32 =
new MamaPricePrecision ((byte) 0x1a, "TICK_32");
static final MamaPricePrecision PRECISION_HALF_32 =
new MamaPricePrecision ((byte) 0x1b, "HALF_32");
static final MamaPricePrecision PRECISION_QUARTER_32 =
new MamaPricePrecision ((byte) 0x1c, "QUARTER_32");
static final MamaPricePrecision PRECISION_TICK_64 =
new MamaPricePrecision ((byte) 0x1d, "TICK_64");
static final MamaPricePrecision PRECISION_HALF_64 =
new MamaPricePrecision ((byte) 0x1e, "HALF_64");
static final MamaPricePrecision PRECISION_10000000000000000 =
new MamaPricePrecision ((byte) 0x1f, "10000000000000000");
Updated on 2023-03-31 at 15:29:43 +0100