filter on inputfield of type number

Hello,

I have a collection with plants and their heights (the field is of the type’Number’).
I would like to filter on plants that are higher than a value in an inputfield, but only when a number is entered. There are other fields as well and there are also filters on these other fields.

I have in my code (simplified):

let minheight = 0;
if ($w(“#input3”).value!==‘’) {
minheight = $w(“#input3”).value;
}

and in the filter:
.ge("height ", minheight )

Now, when I filter with no value in #input3 it gives back an empty set.
But when I put 0 in the inputbox it does give back the desired set of the collection.

Is there any difference between the 0 I assign to minheight compared to a 0 from the inputbox itself?
I can’t understand why this would not work.
I also put in a console.log(minheight ) and in both cases it shows 0. However, the 0 when I don’t enter anything in the inputbox is green in color while the 0 from the inputbox (or any number for that matter) is black in color. Maybe that helps…

I also tried
let minheight = 0.0;
and
let minheight = 1-1;
that also does not matter…

Thanks!
Marcel

I found the answer. To compare numeric fields you have to use a string.
So let minheight = “0” makes it work