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

Add custom formater for very small number in Numeral.js #53676

Closed
Angel0r opened this issue Dec 20, 2019 · 4 comments
Closed

Add custom formater for very small number in Numeral.js #53676

Angel0r opened this issue Dec 20, 2019 · 4 comments
Labels
enhancement New value added to drive a business result Feature:FieldFormatters impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort

Comments

@Angel0r
Copy link

Angel0r commented Dec 20, 2019

Describe the feature:
Numeral.js supports custom formaters but not for very "very" small numbers.

Describe a specific use case for the feature:
Specifically in metric visualisation, kibana cannot show very small numbers, shorter. So for example I want show this number "5.123,123,123,324,234e-53" like "5.123e-53".

@TinaHeiligers TinaHeiligers added Feature:MetricVis Metric visualization feature Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Dec 26, 2019
@elasticmachine
Copy link
Contributor

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

@wylieconlon wylieconlon added Feature:FieldFormatters and removed Feature:MetricVis Metric visualization feature labels Dec 30, 2019
@wylieconlon
Copy link
Contributor

wylieconlon commented Dec 30, 2019

Just confirmed that we don't have formatting support for this, for both negative and positive values. There is already a scientific notation formatter which does not allow control over the number of digits shown:

0,0.0e+0

1.23456789e-15  |  +1.23,456,789e-15
1.99e+22        |  +1.99e+22
0,0e-0

1.23456789e-15  |  1.23,456,789e-15
1.99e+22        |  1.99e+22

I would imagine that we don't want to break existing formatters, so maybe we can add a new formatter for this.

The closest fit to this request might actually be a formatter that accepts a fixed # of digits to show, similar to the numeral-js fork numbro: https://numbrojs.com/format.html

We could build a custom formatter for "Fixed length number" and "Fixed length scientific notation" for example, neither of which requires numeraljs formatting to implement.

The biggest reason to stick with numeraljs is its number locale support. Otherwise, there is built-in JS support for the following operations:

(19900000000000000000000).toFixed(2) -> 1.99e+22
(0.00000000000000123456789).toExponential(2) -> 1.23e-15

@timroes timroes added Team:AppArch and removed Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Mar 27, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@lukeelmers lukeelmers added the enhancement New value added to drive a business result label Jul 2, 2020
@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Jun 14, 2021
@exalate-issue-sync exalate-issue-sync bot added loe:medium Medium Level of Effort and removed loe:small Small Level of Effort labels Jun 22, 2021
@exalate-issue-sync exalate-issue-sync bot added loe:small Small Level of Effort and removed loe:medium Medium Level of Effort labels Jan 12, 2022
@petrklapka
Copy link
Member

Thank you for contributing to this issue, however, we are closing this issue due to inactivity as part of a backlog grooming effort. If you believe this feature/bug should still be considered, please reopen with a comment.

@petrklapka petrklapka closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2022
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:FieldFormatters impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort
Projects
None yet
Development

No branches or pull requests

7 participants