In [1]: from decimal import Decimal, getcontext
In [2]: getcontext().prec = 4
In [3]: Decimal('0.12345')
Out[3]: Decimal('0.12345')
In [4]: Decimal('0.12345') * Decimal('0.12345')
Out[4]: Decimal('0.01524')
I was expecting '0.1234'
and '0.0152'
for the second.
Is there a way to achieve this?