How do I make an input box accept numbers only?

@GoToLoop do you mind checking my isNumber function? It works and I can’t seem to be able to ‘break’ it but I want to know if it’ll always work.

Thanks.

https://editor.p5js.org/Bassam/sketches/KUOzRI4AI