Skip to content

Postfix numbers are shown in scientific notation  #621

@HatScripts

Description

@HatScripts
  • I have visited the source website, and in particular, read the known issues
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and environment, where applicable:
print(tqdm.__version__)  # 4.26.0
print(sys.version)  # 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)]
print(sys.platform)  # win32

All numbers greater than 999 in the postfix are shown in the progress bar in scientific notation.
Examples:

Input Output
1000 1e+03
1005 1.00e+03
1174 1.17e+03
1509 1.51e+03

As you can see (at least for smaller numbers) it's

  • harder to read
  • less precise
  • more verbose

Is this the intended behaviour? If so, how can I disable it? The unit_scale and unit_divisor params in the constructor looked promising, but they don't seem to be related to this.

Here's a MWE:

from tqdm import tqdm

with tqdm() as bar:
    bar.set_postfix({"some_number": 1000})

which outputs:

0it [00:00, ?it/s, some_number=1e+03]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions