2017-03-21 07:45:12 +00:00
|
|
|
var cfregex = /\[[=<>]/;
|
2018-02-21 03:35:31 +00:00
|
|
|
var cfregex2 = /\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;
|
2017-03-21 07:45:12 +00:00
|
|
|
function chkcond(v, rr) {
|
|
|
|
if(rr == null) return false;
|
|
|
|
var thresh = parseFloat(rr[2]);
|
|
|
|
switch(rr[1]) {
|
|
|
|
case "=": if(v == thresh) return true; break;
|
|
|
|
case ">": if(v > thresh) return true; break;
|
|
|
|
case "<": if(v < thresh) return true; break;
|
|
|
|
case "<>": if(v != thresh) return true; break;
|
|
|
|
case ">=": if(v >= thresh) return true; break;
|
|
|
|
case "<=": if(v <= thresh) return true; break;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|