javascript - How to hide the class with values less than 1.6 -
i have code hides rows values 1.6.
$('.ind').filter(function() { return $(this).text().indexof("1.6") !== -1; }).parent().hide();
i interested in code hides values less 1.6.
please see link.
you need parse value compare number:
$('.ind').filter(function() { return parsefloat($(this).text()) < 1.6; }).parent().hide();
the code in question looks value 1.6 inside string, leads me think there may other text number in cell. if so, need remove before parsing:
$('.ind').filter(function() { return parsefloat($(this).text().replace(/[^\d\.]+/g, '')) < 1.6; }).parent().hide();
to check range, put parsed value in variable, compare lower , upper limit , return result:
$('.ind').filter(function() { var value = parsefloat($(this).text()); return value >= 1.6 && value < 1.7; }).parent().hide();