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

[Lens] Change default formatter for percentages to 0.[00] #72320

Closed
kmartastic opened this issue Jul 17, 2020 · 6 comments · Fixed by #70703
Closed

[Lens] Change default formatter for percentages to 0.[00] #72320

kmartastic opened this issue Jul 17, 2020 · 6 comments · Fixed by #70703
Labels
enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@kmartastic
Copy link
Contributor

Default number formatting for percentages should not include 3 digits.
Suggestion: 1 digit after the decimal.

image

@kmartastic kmartastic added Team:Visualizations Visualization editors, elastic-charts and infrastructure :Lens/basic-expectation labels Jul 17, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@flash1293
Copy link
Contributor

This makes sense to me, 3 digits seem too much for common use cases. @AlonaNadler what do you think?

@wylieconlon
Copy link
Contributor

To document the current state of things, we need to talk about three settings:

  • Pie charts in Lens default to percent mode with 3 decimals
  • Lens has a percent formatter which can be used for metrics, and has a default of 2 decimals
  • Kibana has a percent formatter which is applied to fields, and has a default of 3 decimals that skip trailing zeroes

Based on the screenshot, I know this is talking about pie charts. But the title is pretty broad. Should we also change the default for the other Lens percent formatter?

@kmartastic
Copy link
Contributor Author

Yes, I would vote for consistent number formatting across Lens/Kibana.

@flash1293 flash1293 added the enhancement New value added to drive a business result label Aug 6, 2020
@wylieconlon wylieconlon changed the title Default number format for percentages includes 3 digits after the decimal. [Lens] Change default formatter for percentages to 0.[00] Sep 1, 2020
@wylieconlon
Copy link
Contributor

Based on @AlonaNadler's comment here, we now have a clear choice being made: #70703 (comment)

This makes two changes:

  • Default number of decimals moves from 3 -> 2
  • Stop using a fixed number of decimal places, instead use maximum of N decimal places. The table below explains this difference:
Input value User choices Current output Output with new decision
6 Default 6.000% 6%
6.1 3 decimals 6.10% 6.1%
5.9090 Default 5.919% 5.91%
5.9090 1 decimal 5.9% 5.9%
5.9090 3 decimals 5.919% 5.919%

In numeral terms, this pattern switches from 0.000% to 0.[00]% as default.

@AlonaNadler
Copy link

The table is very helpful, thanks @wylieconlon looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants