Converting inputs into int types

I’m trying to take in user number inputs, convert them into int types, multiply, convert the outcome back into a string, and print this out. I keep getting the Not a Number result when ever i try int(input.value()). does anyone know how to do this properly?

Please see previous post, this has been asked before Covert String to Integer

this post is not the same question. I’m trying to convert an input.value() into an integer in p5.js not processing. When I use the normal string to integer method I get NaN.

Woops so it is, have you tried an if statement before arising the string. It might be that some conditions return a blank string without a number

Ie if(input.value()!="")

Are you specifying an input of type “number”? :thinking:
input = createInput('0', 'number');

p5js.org/reference/#/p5/createInput
Developer.Mozilla.org/en-US/docs/Web/HTML/Element/input/number