Constucts an object from a decimal string.
Constucts an object from another Decimal object. This constructor is used to transforming precision.
Constucts an object from a BigInt object.
Constucts an object from an integer number (int/uint, long/ulong, etc.).
Constucts an object from a floating point number. (For good precision, give preference to forming a decimal number from a string.)
Gets the modulus.
Gets a sign of the decimal number (-1, 0 or 1).
Check if Decimal has zero fractional part.
Check if Decimal has zero value.
Implements binary operators between Decimals. Returns an object with the maximum precision of both original objects.
Implements binary operators between Decimal and build-in type values.
Implements operators with built-in integers on the left-hand side and Decimal on the right-hand side.
Converts to a boolean value.
Converts to a floating type, if possible.
Converts to an integer type, if possible.
Implements comparison of Decimal with other Decimal.
Implements comparison of Decimal with other numeric types and strings.
Implements Decimal equality test with other Decimal.
Implements Decimal equality test with buil-in numeric types and strings.
Implements assignment operators of the form Decimal op= integer: "+=", "-=", "*=", "/=", "^^=". Position of the fixed point (precision) doesn't change.
Implements Decimal unary operator "++".
Implements Decimal unary operator "--".
Implements Decimal unary operator "+".
Implements Decimal unary operator "-".
Calculates and returns the rounded value. The fixed point position in the return value remains the original.
Converts to a human readable decimal string. All characters after the dot (with all zeros) will be shown according to the configured fixed point position.
Convert the Decimal to string, passing it to the given sink.
A struct representing a decimal fixed-point number.
By default, the number of digits after the decimal point is 18. The decimal point position is limited by the maximum value of the size_t data type. Decimal is based on std.bigint.BigInt and have no limitation for the number of significant digits.