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

%Ng formatting for floats not available as an option #42

Open
GoogleCodeExporter opened this issue Sep 1, 2015 · 1 comment
Open

%Ng formatting for floats not available as an option #42

GoogleCodeExporter opened this issue Sep 1, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

The differences between %f and %g are described here:

http://stackoverflow.com/questions/5913102/what-is-the-difference-between-g-and-
f-in-c

I am attaching a simple program to illustrate some differences on real data.

Here is the output:

+---------------+------------------+--------------+-------------+
|       default |        floatFmt1 |    floatFmt2 |        gFmt |
+---------------+------------------+--------------+-------------+
| 123456789.123 | 123456789.123400 | 123456789.12 | 1.23457e+08 |
|      0.000122 |         0.000122 |         0.00 |    0.000122 |
|            23 |        23.000000 |        23.00 |          23 |
|    1.01010101 |         1.010101 |         1.01 |      1.0101 |
+---------------+------------------+--------------+-------------+

Original issue reported on code.google.com by and...@andrewschein.com on 24 Nov 2013 at 7:16

Attachments:

@GoogleCodeExporter
Copy link
Author

Thanks for this report.  Part of the planned changes for the next release of 
PrettyTable is to introduce better support for various kinds of formatting 
(e.g. exponential notation, hexadecimal, etc.).  I'll make sure that the %g 
style is readily available.

Original comment by luke@maurits.id.au on 24 Nov 2013 at 7:27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant