Skip to content

Glossary: Python Basics

quantize

Also written: .quantize()

A `Decimal` method that rounds a number to the decimal places of another one. `Decimal("12.5").quantize(Decimal("0.01"))` gives `12.50`, rounded to cents.

Where the book teaches it

Related terms

Decimal