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

Numeral field formatter large number output invalid #59415

Closed
kertal opened this issue Mar 5, 2020 · 5 comments · Fixed by #99609
Closed

Numeral field formatter large number output invalid #59415

kertal opened this issue Mar 5, 2020 · 5 comments · Fixed by #99609
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:FieldFormatters impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort

Comments

@kertal
Copy link
Member

kertal commented Mar 5, 2020

Kibana version:
master, 7.6.0

Describe the bug:

Formatting large numbers with our default formatting template 0,0.[000], the numeral field formatter outputs other formatted numbers as expected. Eg instead of 87,595,752,619,485, it outputs 87,595,752,619,484.984

Steps to reproduce:

  1. create the following index + doc
PUT telemetry
{
  "mappings": {
      "properties": {
        "long": {
          "type": "long"
        }
      }
    },
    "settings": {
      "index": {
        "number_of_replicas": "1",
        "number_of_shards": "1"
      }
    }
}

PUT telemetry/_doc/1
{
  "long": "87595752619485"
}
  1. create an index pattern
  2. navigate to discover, use the index pattern, expand the document. now in the table view of the document you can see the invalid output

Bildschirmfoto 2020-03-05 um 13 49 07

When you change the index pattern numeral format of the field to 0 it's formatted correctly.
Browsers have issue with 64bit numbers/integer. #40183. However the number used for this demo isn't that big, but maybe an internal calculation of numeral is exceeding the limit and causes this problem?

@kertal kertal added bug Fixes for quality problems that affect the customer experience Feature:FieldFormatters Team:AppArch labels Mar 5, 2020
@elasticmachine
Copy link
Contributor

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

@kertal kertal added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Mar 5, 2020
@smalenfant
Copy link

This doesn't seem to happen in 7.0.1.

@kertal
Copy link
Member Author

kertal commented Mar 6, 2020

@smalenfant thx for testing! 👍

@timroes timroes removed the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Mar 15, 2020
@lukeelmers
Copy link
Member

lukeelmers commented Jul 5, 2020

This doesn't seem to happen in 7.0.1.

I just tested this on a 7.0.1 cloud deployment, and I'm still able to reproduce the issue there. @smalenfant are you doing anything different other than what's described above to see this fixed in 7.0.1?

At any rate, this appears to be an issue in numeral that was resolved in numeral version 1.5.4 (I believe by this commit). Here's a comparison of the behavior in Numeral in 1.5.3 vs 1.5.4 demonstrating the discrepancy:

1.5.3: http://jsfiddle.net/scjr5qkm/

1.5.4: http://jsfiddle.net/s0bfcz3t/

We maintain our own fork of numeral for Kibana, and it was most recently built on 1.5.3, so cherry-picking the commit into our fork, or rebasing on top of 1.5.4 would likely resolve the issue.

@lukeelmers lukeelmers added impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort triaged and removed regression labels Jul 5, 2020
@streamich
Copy link
Contributor

streamich commented May 5, 2021

I can verify in Kibana 7.13 we still have this problem:

image

streamich added a commit that referenced this issue May 11, 2021
Fixes bing integer formatting bug.

✅ Closes: #59415
streamich added a commit that referenced this issue May 11, 2021
Fixes bing integer formatting bug.

✅ Closes: #59415
streamich added a commit that referenced this issue May 11, 2021
Fixes bing integer formatting bug.

✅ Closes: #59415
streamich added a commit that referenced this issue May 11, 2021
Fixes bing integer formatting bug.

✅ Closes: #59415
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:FieldFormatters impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants