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

Round to 9 decimal places for formulas w/o a user-set decimal places #893

Merged
merged 8 commits into from
Nov 28, 2023

Conversation

ddimaria
Copy link
Collaborator

@ddimaria ddimaria commented Nov 28, 2023

Addresses #877

  • Round to 9 decimal places when user hasn't set decimals for Formulas
  • Round to 9 decimals places in the summary, no trailing zeros

Copy link

vercel bot commented Nov 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
quadratic ✅ Ready (Inspect) Visit Preview Nov 28, 2023 8:19pm

@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-893 November 28, 2023 00:55 Inactive
Copy link

codecov bot commented Nov 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (67887e5) 88.16% compared to head (e2ae59b) 88.18%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #893      +/-   ##
==========================================
+ Coverage   88.16%   88.18%   +0.02%     
==========================================
  Files          99       99              
  Lines       17317    17327      +10     
==========================================
+ Hits        15267    15280      +13     
+ Misses       2050     2047       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ddimaria ddimaria marked this pull request as ready for review November 28, 2023 01:00
@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-893 November 28, 2023 01:00 Inactive
@ddimaria ddimaria linked an issue Nov 28, 2023 that may be closed by this pull request
2 tasks
@davidkircos
Copy link
Collaborator

Bottom bar still shows too many decimals for sum. Everything else appears to work as expected!

CleanShot 2023-11-27 at 20 56 54@2x

@ddimaria
Copy link
Collaborator Author

Bottom bar still shows too many decimals for sum. Everything else appears to work as expected!

CleanShot 2023-11-27 at 20 56 54@2x

This is resolved. The frontend was forcing a decimal size, now rounding happens in Rust, though significant digits are supplied by TS.

Copy link
Collaborator

@davidkircos davidkircos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sum and average show more than 9 decimals

CleanShot 2023-11-28 at 11 58 34@2x

@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-893 November 28, 2023 20:14 Inactive
@ddimaria
Copy link
Collaborator Author

There was an issue in the summary where we convert to a f64 after rounding that introduced unwanted behavior.....because floats. I added a round function for working directly f64s to mitigate this.

@ddimaria ddimaria merged commit c9f6b8a into main Nov 28, 2023
8 checks passed
@ddimaria ddimaria deleted the bug-too-many-digits-by-default-with-formulas branch November 28, 2023 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

bug: too many digits by default with formulas (default to 9)
3 participants