Jquery- Check if is valid price or not

Check the valid price in Jquery. If the price is valid or not.It returns TRUE or FALSE.

function CheckValidPrice(price=0){
 var tempPrice = Math.round(price * 100)/ 100;
 var RE = /^(?!^0*$)(?!^0*\.0*$)^\d{1,7}(\.\d{1,2})?$/;
 return true;
 return false;

Leave a Reply

Your email address will not be published. Required fields are marked *