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

feat: Truncate Point and RothC output up to five significant figures #91

Merged
merged 3 commits into from
Oct 11, 2021
Merged

feat: Truncate Point and RothC output up to five significant figures #91

merged 3 commits into from
Oct 11, 2021

Conversation

iamrajiv
Copy link
Member

@iamrajiv iamrajiv commented Oct 9, 2021

Screenshot 2021-10-12 at 4 01 20 AM

Screenshot 2021-10-12 at 4 01 32 AM

Signed-off-by: Rajiv Ranjan Singh <rajivperfect007@gmail.com>
@aornugent
Copy link
Collaborator

Hi @iamrajiv - this is better, having consistency in the columns helps (I don't know what is happening in step 4 for PLANTCM).

I think a better way to implement it would be using .toPrecision which would make it easier to implement variable precision
(i.e. provide a button to increase or decrease the number of significant figure) in a future PR.

Signed-off-by: Rajiv Ranjan Singh <rajivperfect007@gmail.com>
@iamrajiv iamrajiv requested a review from aornugent October 11, 2021 20:55
@iamrajiv
Copy link
Member Author

@aornugent I have updated the code and the screenshot please review once.

@aornugent
Copy link
Collaborator

Closer! How come you went for toFixed? It sets a fixed number of decimal places, which leads to some numbers being very long. If we set the number of significant figures, then every data point should've roughly the same length, and closer to how humans interpret numbers (e.g. If a number is 1000, I usually don't care about differences of 0.00001)

Please try toPrecision?

Also, .toFixed formats the result as a string right?could we use that for formatting numeric values in our state config rather than the $$ syntax?

Signed-off-by: Rajiv Ranjan Singh <rajivperfect007@gmail.com>
@aornugent
Copy link
Collaborator

Awesome! Can you please file two issues:

  1. repeat this process to format the date column more clearly.

  2. add a component to increase or decrease the table precision dynamically.

Thanks for your hard work!

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