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

range: Fix getting decimal part of numbers close to 0 #4909

Merged
merged 1 commit into from
Jan 11, 2025

Conversation

obiwac
Copy link
Contributor

@obiwac obiwac commented Jan 9, 2025

New Pull Request

Previously, isFloat was being called on val before noExponents. This meant that if a value was particularly close to zero, it might pass the isFloat check but then be stripped down to just 0 by noExponents, which meant that getting the second element after splitting around the decimal point would fail.

This patch just does noExponent first so that if the value ends up being a round number, it doesn't enter that branch.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • My branch is up to date with any changes from the main branch

Previously, isFloat was being called on val before noExponents. This
meant that if a value was particularly close to zero, it might pass the
isFloat check but then be stripped down to just 0 by noExponents, which
meant that getting the second element after splitting around the decimal
point would fail.
Copy link

@mjchang mjchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - coincidentally just encountered this too #4911

@junedchhipa junedchhipa merged commit 8ffdb61 into apexcharts:main Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants