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

Format scientific float #1007

Merged
merged 3 commits into from
Mar 8, 2024
Merged

Format scientific float #1007

merged 3 commits into from
Mar 8, 2024

Conversation

jrchudy
Copy link
Member

@jrchudy jrchudy commented Mar 7, 2024

Changes in this PR are intended to improve how we are displaying formatted float values when no pre-format annotation is provided. We noticed the browser will automatically change a number after a certain threshold to display in scientific notation.

We discussed in our meeting with Hongsuda that the thresholds for our code should be 1 trillion (or more than 12 digits) and 0.0000007 (or more than 6 decimal places before the first non zero digit is present).

I noted in the code that this is still not ideal since there is a range where some values won't "display" since our default display is 4 digits after the zero. So when there are 5 or 6 digits after the zero, the digits in the 5th and 6th place might be lost when displayed. The workaround for this is to use the pre-format annotation. This limitation exists in the code before this branch is merged. If this needs to be addressed, we should do it separately and also discuss handling trailing values being truncated too (10000000000001 will have the last 1 changed to a 0).

@jrchudy jrchudy requested a review from RFSH March 7, 2024 19:23
@jrchudy jrchudy self-assigned this Mar 7, 2024
@jrchudy jrchudy merged commit 1212606 into master Mar 8, 2024
1 check passed
@jrchudy jrchudy deleted the format-scientific-float branch March 8, 2024 00:46
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

Successfully merging this pull request may close these issues.

2 participants