liveBook · Manning

Decimal

As explained in ScyllaDB in Action

DECIMAL is a ScyllaDB arbitrary-width decimal data type that represents values precisely.

DECIMAL stores numbers with a decimal point at arbitrary width, preserving their exact value. It suits monetary values and other calculations where FLOAT or DOUBLE rounding errors are unacceptable. section 4.2.2

Choose DECIMAL when numeric accuracy or unusually large values matters:

  • Use DECIMAL for monetary values when rounding errors from limited-precision FLOAT and DOUBLE types would be harmful. section 4.2.2
  • Use an integer base unit, such as cents, when storing money as an integer and formatting it later is more appropriate. section 4.2.2
  • Use DECIMAL or VARINT when values may exceed the range of BIGINT or require arbitrarily large numeric sizes. section 4.2.2

How ScyllaDB in Action covers it

How deep it goes
Defines arbitrary width and precision, contrasts rounding risks, and stops short of detailed storage or arithmetic internals.
Examples
Uses monetary values, base-unit integer storage such as cents, and numeric values beyond BIGINT’s range.
What you can do after
Evaluate/understand numeric type choices for accuracy, monetary storage, and unusually large values.
How it connects
Contrasts DECIMAL with FLOAT, DOUBLE, BIGINT, VARINT, and integer-based monetary storage.

Also explained in

Compare how 5 books explain Decimal →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ScyllaDB in Action. The section links point to the parts of the book it draws on.