def doctest_precision():
    "doctest for %precision\n    \n    In [1]: f = get_ipython().display_formatter.formatters['text/plain']\n    \n    In [2]: %precision 5\n    Out[2]: '%.5f'\n    \n    In [3]: f.float_format\n    Out[3]: '%.5f'\n    \n    In [4]: %precision %e\n    Out[4]: '%e'\n    \n    In [5]: f(3.1415927)\n    Out[5]: '3.141593e+00'\n    "
doctest for %precision

In [1]: f = get_ipython().display_formatter.formatters['text/plain']

In [2]: %precision 5
Out[2]: '%.5f'

In [3]: f.float_format
Out[3]: '%.5f'

In [4]: %precision %e
Out[4]: '%e'

In [5]: f(3.1415927)
Out[5]: '3.141593e+00'
def doctest_precision():
    "doctest for %precision\n    \n    In [1]: f = get_ipython().display_formatter.formatters['text/plain']\n    \n    In [2]: %precision 5\n    Out[2]: '%.5f'\n    \n    In [3]: f.float_format\n    Out[3]: '%.5f'\n    \n    In [4]: %precision %e\n    Out[4]: '%e'\n    \n    In [5]: f(3.1415927)\n    Out[5]: '3.141593e+00'\n    "