Is there a better (faster, more efficient, or "just more pythonic") way than my way in rounding Decimals in Python? I came up with the following:
sign, digits, exponent = the_number.as_tuple()
Decimal((sign, digits[:exponent+len(digits)+decimal_places],-decimal_places))
edit: I ended up using yet another solution that is faster[1] and also "fills" the decimal to the wanted precision:
decimal.Decimal('%.*f' % (decimal_places, number))
[1] It is faster up to ~200 decimal places. In my case I get a random float-value I want to "cast" to decimal, so the original precision is already limited and << 200.