Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64
Your IP : 3.144.105.101
function isNum(num, minValue, maxValue){
//System constants
var AllowedNotations = ",";
var AllowedChars = "0123456789.,";
var i = 0;
//Check if the num contains nothing other than numbers, comas and periods
for(i=0; i<num.length; i++){
if(AllowedChars.indexOf(num.substr(i,1)) == -1){
return false;
}
if(AllowedNotations.indexOf(num.substr(i,1)) != -1){
num = num.replace(",", ".");
}
}
//Check the min and max values
if(num < minValue || num > maxValue){
return false;
}
//Num is ok
return true;
}
|