-
Notifications
You must be signed in to change notification settings - Fork 18
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 the usage percentage to 1 decimal point #1370
base: main
Are you sure you want to change the base?
Round the usage percentage to 1 decimal point #1370
Conversation
@jcscottiii please review my changes :) ! Seems like the workflows need your approval to run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yingyingcheng thanks for the contribution! Can you make a common helper method named formatUsagePercentage that both the value extractor and tool tip extractor use?
Thanks for modifying both extractors by the way. If you only modified the tooltip, the value extractor would still have the raw value. Causing the graph to be potentially confusing compared to the value in the tooltip.
FYI The playwright test for the feature page failed due to the new rounding of the values. You will need to regenerate the screenshots |
@Yingyingcheng Thanks for re-generating the screenshots. Could you also take a look at this feedback in this comment:
|
@jcscottiii just updated, sorry! I forgot to commit the changes from that file |
Context
As described in #1044, the feature usage chart was displaying percentages with an excessive number of decimal places. We want to eliminate this visual noise and just show one decimal place.
Changes
webstatus-feature-usage-chart-panel.ts
to use the toFixed() method to round usage percentages to 1 decimal place. Note that toFixed returns a string, so forvalueExtractor
, I had to convert it back to a number.webstatus-feature-usage-chart-panel.test.ts
to update and add one test case to make sure the changes are covered in the tests.