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:
Faris Ansari 2018-11-29 13:41:07 +05:30
parent ec08d75261
commit f791c91df6
2 changed files with 66 additions and 50 deletions

File diff suppressed because one or more lines are too long

View File

@ -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);