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

Large numbers in pretty printing #152

Closed
sharkdp opened this issue Sep 12, 2023 · 7 comments · Fixed by #244
Closed

Large numbers in pretty printing #152

sharkdp opened this issue Sep 12, 2023 · 7 comments · Fixed by #244

Comments

@sharkdp
Copy link
Owner

sharkdp commented Sep 12, 2023

This is not helpful:

>>> let sun_luminosity = 3.828e26 W

  let sun_luminosity = 382800000000000000000000000 watt
@sharkdp
Copy link
Owner Author

sharkdp commented Sep 19, 2023

@sharkdp
Copy link
Owner Author

sharkdp commented Sep 26, 2023

Also: let's look into formatting large (integer) numbers with spaces as separators. Qalculate does this, and I think it's quite neat:

image

@irevoire
Copy link
Contributor

I think it would be better to use underscore so we can copy-paste it back in numbat if possible 🥺

@sharkdp
Copy link
Owner Author

sharkdp commented Oct 21, 2023

I think it would be better to use underscore so we can copy-paste it back in numbat if possible 🥺

For the web version, I believe that there might be a way to show a space, but to leave the actual content as "123456789".

Maybe we could even make this work for the CLI version if we use a special space character, like a non-breaking space (U+00A0).

@irevoire
Copy link
Contributor

Then it would be nice to accept the non-breaking-space as a valid character in the cli because they will get copy-pasted.
If we do that, it could actually work in the web version as well, I guess? 🤔

@sharkdp
Copy link
Owner Author

sharkdp commented Oct 21, 2023

Then it would be nice to accept the non-breaking-space as a valid character in the cli because they will get copy-pasted.

Yes, exactly. We could treat the non-breaking space similar to how we treat the underscore.. I assume

If we do that, it could actually work in the web version as well, I guess? 🤔

True, yes

@sharkdp sharkdp added this to the 1.8 milestone Nov 10, 2023
sharkdp added a commit that referenced this issue Nov 10, 2023
- Thousands separator for large inters
- Always use '+' in scientific notation (1e+3)

closes #152
sharkdp added a commit that referenced this issue Nov 10, 2023
- Thousands separator for large inters
- Always use '+' in scientific notation (1e+3)

closes #152
@sharkdp
Copy link
Owner Author

sharkdp commented Nov 11, 2023

Decided to go with an underscore for now, as this non-breaking space caused some problems when copy pasting.

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

Successfully merging a pull request may close this issue.

2 participants