Skip to content

Glossary: Python Beyond the Basics

Decimal

Also written: decimal, quantize, InvalidOperation

A number type for exact decimal arithmetic, used for money so amounts add up with no tiny float errors. `.quantize(CENT)` rounds to two decimal places.

Where the book teaches it

Related terms

cents storage (whole-number money)