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

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

java - How to create Table using Apache PDFBox -

mpi - Why is MPI_Bsend not returning error even when the buffer is insufficient to accommodate all the messages -