Return to site

Interactive thermodynamics 3.2 show more decimal command

broken image
broken image

The quantize() method rounds to a fixed number of decimal places. Others are not supposed to have excess digits and need to be validated. In a fixed-point application with two decimal places, some inputs have many places and need to be rounded. If so, the Decimal FAQ section of the docs has a question/answer pair which may be useful for you: I suppose you're probably using the Decimal() objects from the decimal module? (If you need exactly two digits of precision beyond the decimal point with arbitrarily large numbers, you definitely should be, and that's what your question's title suggests.)

broken image