FilterService: match modes "equals" and "not equals" do not work with numeric filter on fractional values #14978
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
The use case is a table with a column that has numeric values which are formatted to have a fixed number of decimal digits, like so:
1.0
,1.5
, etc.A column filter of type "numeric" works as expected when the match modes "less than (or equal to)" or "greater than (or equal to)" are used. However, using "(not) equals" always yield zero matching rows.
The problem is that while
1 == '1.0'
or1.0 == '1.0'
or1.000 == '1.0'
is alltrue
, which is the comparison for the working match modes, the "(not) equals" match modes convert both values to strings first, in which case the result is alwaysfalse
.Environment
Since there's a StackBlitz reproduction, I don't think our environment matters.
Reproducer
https://stackblitz.com/edit/9nkhvs
Angular version
17.2.4
PrimeNG version
17.9.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.10.0
Browser(s)
No response
Steps to reproduce the behavior
In the linked StackBlitz:
Expected behavior
2
should yield the row with the value2.0
.2
should yield all other rows.The text was updated successfully, but these errors were encountered: