Decimal

Decimal type.

Members

Functions

addExponent
Decimal addExponent(ubyte n)

Add exponent and shift mantissa.

ceil
Decimal ceil()

Calcurate ceil value.

floor
Decimal floor()

Calcurate floor value.

opBinary
Decimal opBinary(const(Decimal) rhs)

Calculate other price.

opBinary
Decimal opBinary(long rhs)

Calculate mul and div.

opBinary
Decimal opBinary(const(Decimal) rhs)

Calculate mul.

opCast
auto opCast()

Convert to floating point.

opCmp
int opCmp(const(Decimal) other)

Compare two prices.

opEquals
bool opEquals(const(Decimal) other)

Compare other price number.

toHash
size_t toHash()
toString
string toString()

Properties

normalized
Decimal normalized [@property getter]

Normalize mantissa and exponent.

Static functions

from
Decimal from(const(T) value, ubyte exponent)

Convert from floating point.

fromString
Nullable!Decimal fromString(const(char)[] s)

Parse price number from string.

Static variables

max
immutable(Decimal) max;

price number.

min
immutable(Decimal) min;

Min price number.

Variables

exponent
ubyte exponent;

Number exponent.

mantissa
long mantissa;

Number mantissa.

Meta