[Python] How do I control number formatting in the python interpreter?

Discussão em 'Python' iniciado por Stack, Novembro 25, 2025.

  1. Stack

    Stack Membro Participativo

    I often use the python interpreter for doing quick numerical calculations and would like all numerical results to be automatically printed using, e.g., exponential notation. Is there a way to set this for the entire session?

    For example, I want:

    >>> 1.e12
    1.0e+12


    not:

    >>> 1.e12
    1000000000000.0

    Continue reading...

Compartilhe esta Página