fix(InputNumber): fix decimal rounding on spin#8392
fix(InputNumber): fix decimal rounding on spin#8392melloware merged 1 commit intoprimefaces:masterfrom
Conversation
|
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>. |
|
GitHub Copilot Chat Assistant Quick summary
Problems I found in current diff
Suggested robust implementation
Example implementation (replace your function with this) const addWithPrecision = (base, increment) => { const baseDec = countDecimals(base); // cap decimals to avoid factor > Number.MAX_SAFE_INTEGER // If scaling would overflow, fall back to simple addition with an approximate rounding return Math.round(base * factor + increment * factor) / factor; Behavior examples you can use to test
Recommendations
If you want, I can:
|
9ad245e to
1b71e42
Compare
|
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>. |
|
I have amended to factor in exponential numbers and added some tests |
|
please run |
1b71e42 to
29e0d41
Compare
|
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>. |
|
Formatting updated |
|
ok |
29e0d41 to
fc781d8
Compare
|
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>. |
|
Done |
|
weird now its saying the format is wrong again? |
Amended to factor in exponential numbers and added tests with formatting and linting - take 2
fc781d8 to
0d6d511
Compare
|
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>. |
|
It doesn't like my editor white space settings 🤣🤦. I've re-run format and lint. |
Fixes #8382