Giter Site home page Giter Site logo

Comments (7)

hatienloi avatar hatienloi commented on June 18, 2024 1

@archmoj Updated the description with codesandbox link. Thanks!

from plotly.js.

alexcjohnson avatar alexcjohnson commented on June 18, 2024

Interesting, thanks @hatienloi!

I suspect this is due to the fact that with JS floating point, 171.95 actually IS closer to 171.9 than to 172.0:

> 171.95-171
0.9499999999999886

And if so it's going to be tough to fix without breaking numbers that are just a little bit lower, like 171.949999, so really SHOULD round down.

If anyone is interested in taking a crack at this, it will be crucial to add good unit tests

from plotly.js.

hatienloi avatar hatienloi commented on June 18, 2024

Interesting, thanks @hatienloi!

I suspect this is due to the fact that with JS floating point, 171.95 actually IS closer to 171.9 than to 172.0:

> 171.95-171
0.9499999999999886

And if so it's going to be tough to fix without breaking numbers that are just a little bit lower, like 171.949999, so really SHOULD round down.

If anyone is interested in taking a crack at this, it will be crucial to add good unit tests

@alexcjohnson Yes, so weird. Could we have a fix for it

from plotly.js.

archmoj avatar archmoj commented on June 18, 2024

Thanks for the report.
Please provide a link to your codepen in the issue description.

from plotly.js.

archmoj avatar archmoj commented on June 18, 2024

@archmoj Updated the description with codesandbox link. Thanks!

Please note the "latest" bundle you are using is last v1.
In this codepen I use latest v2 plotly.js and I get 172.0 in the hover. Do you get the same number?

from plotly.js.

hatienloi avatar hatienloi commented on June 18, 2024

@archmoj Updated the description with codesandbox link. Thanks!

Please note the "latest" bundle you are using is last v1. In this codepen I use latest v2 plotly.js and I get 172.0 in the hover. Do you get the same number?

@archmoj With 171.9599999 i got the same number like you. But with 171.95 it stills 171.9

from plotly.js.

hatienloi avatar hatienloi commented on June 18, 2024

Hi @archmoj Any update for it? Do we have a patch fix for it?

from plotly.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.