Check for a character in number

Hi, How can i achieve something like I want the user to input a number(let 5 digit) and i wanna check that user did not typed any character or anything else but numbers in that input
for example if user type 54648 its ok but if its 546gf or $84rt or anything like that which is 5 character long but its not a number then i can give error. So how can i do that any suggestions pls

if he typed anything that is not a number, it won’t be registered as a number but as a string.

whatever the user type when you use text entry object it stores everything as string in it
thats where i m stuck. i cant distinguish the user input between string or a number
if a user types 546465 it is stored as string and i need to convert it to number by an expression then i can compare anything with it but dont know how to deal with an input like 546wqr87, how can i prompt the user that this kind of input is not a number

an update to my issue
I found an alternate way to overcome it, instead of comparing or checking it whether user input a number or mix, i made it that way the user can only type numbers anything else he tries to type nothing changes,
so it kinda solved my issue but may be it will be useful to know how to solve this issue more proficiently

Hi there.
Do you mind explaining how exactly you did that, that you restrained the keyboard input to only take in the numbers you type?

Thanks in advance!