ID EN
Decimal

quantize

Python 3.11

Return a value equal to the first operand after rounding and having the exponent of the second operand.

Syntax

PYTHON
quantize(exp, rounding=None, context=None)

Examples

Example 1
PYTHON
>>> Decimal('1.41421356').quantize(Decimal('1.000'))
Decimal('1.414')

See Also

InvalidOperation Etiny()