I use astropy
to make calculations with units and I normally do these calculations in a jupyter notebook so the results are printed nicely. I would like to know how to control the number of digits that are displayed in the notebook. Take a look at this example:
The speed of light is defined to be exaclty c = 29,979,245,800 cm/s
. However, when I print const.c.cgs
in a cell, I get 2.9979246 x 10^10 cm/s
. It rounded it up. I know that the exact value is indeed stored in that constant as can be seen by printing it or accessing its value directly, but it displays it with rounding up. I understand this behavior and it’s fine for most cases, but there are cases like this where I’d like to see more digits. How can I change the number of digits that are printed in the cell? I want to have this pretty printing of jupyter, but I want to see the full value too.
3