Price filter with "less than equal to (.le)" is not working

Hi I have an issue trying to filter an input field with number format, (column of database number type too), using “less than equal to”. Every other filters work properly unless that one.

this is the part that I cant get to work:
. le ( ‘pricetest’ , $w ( ‘#input2’ ). value )

Can anyone help me? I’ll appreciate that so much.

Here is my code:

export function button7_click ( event , $w )

{ 
**if** ( $w ( "#input2" ). value  >  0 ) { 
$w ( '#dataset1' ). setFilter ( wixData . filter () 
    . contains ( 'tipoDePropiedad' ,  $w ( '#dropdown2' ). value ) 
    . contains ( 'habitaciones' ,  $w ( '#dropdown1' ). value ) 
    . contains ( 'banos' ,  $w ( '#dropdown3' ). value ) 
    . contains ( 'title' ,  $w ( '#input1' ). value ) 
    . eq ( 'estadoDeLaPublicacion' ,  'Publicada' ) 
    . le ( 'pricetest' ,  $w ( '#input2' ). value ) 
    ) 
} 

**else**  { 
$w ( '#dataset1' ). setFilter ( wixData . filter () 
    . contains ( 'tipoDePropiedad' ,  $w ( '#dropdown2' ). value ) 
    . contains ( 'habitaciones' ,  $w ( '#dropdown1' ). value ) 
    . contains ( 'banos' ,  $w ( '#dropdown3' ). value ) 
    . contains ( 'title' ,  $w ( '#input1' ). value ) 
    . eq ( 'estadoDeLaPublicacion' ,  'Publicada' ) 
    ) 
} 

$w ( '#repeater1' ). expand (); 
$w ( "#input1" ). collapse (); 
$w ( "#dropdown2" ). collapse (); 
$w ( "#dropdown1" ). collapse (); 
$w ( "#dropdown3" ). collapse (); 
$w ( "#button7" ). collapse (); 
$w ( "#text65" ). collapse (); 
$w ( "#input2" ). collapse (); 

}

Hi there :wave:t2: Check out the API regarding the le() function , it mentions that “It only matches values of the same type.”

Check your database field and input element to make sure they are set to the same property (i.e. both number types, or both String types).

Hi, thanks for your comment both of them are number type

If you test the le() filter with a random number does it work? Like below

.le('pricetest', 500)

Does the console show any errors?

If you add

console.log($w("#input2").value)

within the button click function, what shows in the console?

@lmeyer Hi I did what you said " . le ( ‘pricetest’ , 500 )" and it works fine, but when I enter the original code " . le ( ‘pricetest’ , $w ( ‘#input2’ ). value )" it doesnt seem to do the right thing

also I put the code on the console and this is what I get (attached image)