how to verify if a string just have numbers code example
Example 1: check if string contains numbers
str.matches(".*\\d.*");
Example 2: check if string can be a number and then make a number
if(Number(myNumber) != NaN){
myNumber = Number(myNumber);
}