I have a input filed that allows a user to place a number value which is then transformed into a string value to allow for commas to be added to values above a thousand. for example,
value = 1,000
The problem rises when a number is above 1000000 I want to throw an error. Right now I have an if statement.
if( value > 100000){
//throw error
}
the problem is its not working because the value is a string when the commas are added. say my value is 1000,001.00 I tried using parseInt on the value but it turns it to 1000 Is there a way I can use my if without having to do a replace or something like that on the commas before I do my if statement.
Thanks