Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to format float point output #190

Closed
cmmp opened this issue Oct 27, 2010 · 1 comment
Closed

Add option to format float point output #190

cmmp opened this issue Oct 27, 2010 · 1 comment
Milestone

Comments

@cmmp
Copy link

cmmp commented Oct 27, 2010

Currently it is not possible to format how many digits of precision one wants to have in the output of IPython. For example, typing 1.0/3 returns 0.33333333333333331. In Octave, the same computation returns: ans = 0.33333. The set_printoptions function partially solves this:

In [4]: set_printoptions(precision=4)
In [5]: array([1.0/3])
Out[5]: array([ 0.3333])

However, it doesn't work for regular python floats. Matlab has this, Octave has this (format long/short). It would be very nice if IPython had it too.

@minrk
Copy link
Member

minrk commented Feb 23, 2011

add %precision magic

closed by 637f887

markvoorhies pushed a commit to markvoorhies/ipython that referenced this issue Apr 21, 2011
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants