Advertisement
romeq8787

Untitled

Sep 22nd, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. >>> import decimal
  2. >>> decimal.Decimal('0.1250')
  3. Decimal('0.1250')
  4. >>> ctx = decimal.Context(prec=2, rounding=decimal.ROUND_HALF_UP)
  5. >>> ctx.create_decimal('0.1250')
  6. Decimal('0.13')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement