I have a simple validation rule that checks if the minimum value is greater than maximum value. My numbers can contain decimals, integers and even negative numbers.
Here are some of my values
Minimum Maximum
50 100 (validation working)
-10 -30 (working)
20.1 20 (not working)
The reason the last range is not working is because I have used parseInt due to which it compares 20 to 20. However if I remove parseInt my negative numbers validation does not work.
I am really confused. What is the correct approach?