On this page
  1. decimal.Rounded
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

decimal.Rounded

Prev: decimal.Overflow | Up: decimal | Next: decimal.setcontext
Rel: decimal.Clamped, decimal.Context, decimal.ConversionSyntax, decimal.Decimal
Ref: docs.python.org โ€” decimal.Rounded
Tags: #public #python3 #stdlib #decimal


Import

import decimal
from decimal import Rounded

Signature & Overview

decimal.Rounded(...)

decimal.Rounded class.

Methods & Attributes

Usage

from decimal import Decimal, Rounded, localcontext

with localcontext() as ctx:
    ctx.prec = 3
    _ = Decimal("1") / Decimal("3")
    assert ctx.flags[Rounded] is True

Gotchas

REPL Inspect

from decimal import Rounded
help(Rounded)

Linked from

Related notes