function _calculateNewMax
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.3k
- Forks
- 5.2k
- PR merge metrics
- No merged PRs in 30d
Description
I found a bug in the calculation of the formula in the _calculateNewMax function, but there is also a little bug with js like 0.1+0.2=0.30000000000000004
If we use the library for the price filter, namely the slider from it, and for example if prices come
max - 3469.98
min - 2833.05
step - 0.01
then the formula yields the number 3469.9800000000005
then there is a comparison and 3469.9800000000005 will be greater than 3469.98, we enter the condition and subtract from 3469.9800000000005 - 0.01 and we have 3469.97 at the output, so for example, in the filter we will never see a product with a maximum price
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the jQuery UI source for _calculateNewMax and reproduce the price-filter case with max 3469.98, min 2833.05, and step 0.01. Trace the comparison that produces 3469.9800000000005, then verify that the corrected calculation keeps the maximum value available and add regression coverage if the relevant test location is found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, jquery
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100