Number filter with comparisons and ranges
Provides a numeric filter with the operators equals, notEquals, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual and inRange. Input is parsed according to the active locale. Numeric comparison avoids the wrong results that come from comparing numbers as strings.
Planned. This page shows the specification from issue #187. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A deals grid with an Amount column whose values range from 0 to 100,000. A number filter is set to greaterThan 0.
Expected behavior
Choosing inRange reveals a second 'to' input. With de-DE, typing '10.000,5' is parsed as 10000.5. Toggling inclusivity changes whether the boundary values match.
Planned API surface
columnDefs[].filterType='number'filterParams.inRangeInclusivefilterParams.numberParserfilterModel.valueTofilterParams.allowedCharPatternAcceptance criteria
- Comparisons are numeric: the value 9 is less than 10. (pending)
- inRange with inclusive both ends includes rows equal to the from and to values. (pending)
- When from > to, the filter is treated as invalid: the input is marked invalid and the filter is not applied. (pending)
- Unparseable input marks the field invalid and does not change the displayed rows. (pending)
- Locale-specific decimal and grouping separators are parsed correctly for the 3 demo locales. (pending)