fix: 🐛 Numeric comparison should compare with cell value
Numeric comparison like >, < should compare with the cell value and not the formatted html value
This commit is contained in:
parent
ec08d75261
commit
f791c91df6
110
index.html
110
index.html
File diff suppressed because one or more lines are too long
@ -40,7 +40,7 @@ function getFilterMethod(filter) {
|
||||
greaterThan(keyword, cells) {
|
||||
return cells
|
||||
.filter(cell => {
|
||||
const value = Number(stripHTML(cell.html));
|
||||
const value = parseFloat(cell.content);
|
||||
return value > keyword;
|
||||
})
|
||||
.map(cell => cell.rowIndex);
|
||||
@ -49,7 +49,7 @@ function getFilterMethod(filter) {
|
||||
lessThan(keyword, cells) {
|
||||
return cells
|
||||
.filter(cell => {
|
||||
const value = Number(stripHTML(cell.html));
|
||||
const value = parseFloat(cell.content);
|
||||
return value < keyword;
|
||||
})
|
||||
.map(cell => cell.rowIndex);
|
||||
@ -58,7 +58,7 @@ function getFilterMethod(filter) {
|
||||
range(rangeValues, cells) {
|
||||
return cells
|
||||
.filter(cell => {
|
||||
const value = Number(stripHTML(cell.html));
|
||||
const value = parseFloat(cell.content);
|
||||
return value >= rangeValues[0] && value <= rangeValues[1];
|
||||
})
|
||||
.map(cell => cell.rowIndex);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user