Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13891

How can I print many significant figures in Python?

$
0
0

For a scientific application I need to output very precise numbers, so I have to print 15 significant figures. There are already questions on this topic here, but they all concern with truncating the digits, not printing more.

I realized that the print function converts the input float to a 10 character string. Also, I became aware of the decimal module, but that does not suit my needs.

So the question is, how can I easily print a variable amount of signifcant figures of my floats, where I need to display more than 10?


Viewing all articles
Browse latest Browse all 13891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>