kragniz / kragniz/prettytable

%Ng formatting for floats not available as an option

Open
#42 0 comments 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
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:
- [pretty.py](https://storage.googleapis.com/google-code-attachments/prettytable/issue-42/comment-0/pretty.py)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the attached pretty.py example and tracing the repository's float-formatting entry point to see how existing %f and %g-like options are handled. Done means providing a selectable %g-style format that produces the documented output for the sample values, with coverage for the requested behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.