Check if input is valid number in Jquery or Javascript

It Returns TRUE or FAlSE.
If Valid Number It Returns True , Otherwise False.

<script>
function CheckValidPrice(price=0){     
    var tempPrice = Math.round(price * 100)/ 100;     
    var RE = /^(?!^0*$)(?!^0*\.0*$)^\d{1,7}(\.\d{1,2})?$/;
    if(RE.test(tempPrice))
    {         
        return true;     
    }
    else
    {       
        return false;     
     }     
}
</script>
Please follow and like us: