Aug-22-2019, 12:06 PM
Hello!
I am doing my first steps in programming. I am using Python 3.7.2
I opened interesting numbers for me - Decimal fixed point.
But I have problems with precision setting.
I am trying to use decimal.getcontext( ).prec function.
This example from book works great:
Result:
But than I am trying to do my own example - the precision is not working.
I want to receive 4 digits after point, but instead I received "long number". I thougt may be these number after "0", but format is correct (not ā%eā % num).
Local precision setting also not working.
Example from book:
My example:
Thank you very much for support!
Best regards, Valentina.
I am doing my first steps in programming. I am using Python 3.7.2
I opened interesting numbers for me - Decimal fixed point.
But I have problems with precision setting.
I am trying to use decimal.getcontext( ).prec function.
This example from book works great:
Result:
But than I am trying to do my own example - the precision is not working.
I want to receive 4 digits after point, but instead I received "long number". I thougt may be these number after "0", but format is correct (not ā%eā % num).
Local precision setting also not working.
Example from book:
My example:
Thank you very much for support!
Best regards, Valentina.