input number in Arduino serial monitor

Hi there. The Arduino IDE takes char as input in the serial monitor.

But what do I need to do to make it take int as input such as a number int 123, 56, 89 or float 3.14159...

Thanks

'1' is a char, as is '2' and '3'

I know "all these numbers are chars, but I want 123(one hundred and twenty four) as an int or 3.14159 as a float. Is there a more direct way such stringToInt or stringToFloat?

While I appreciate your quick answer, a more elaborated answer will be nice.

rich4321: I know "all these numbers are chars, but I want 123(one hundred and twenty four) as an int or 3.14159 as a float. Is there a more direct way such stringToInt or stringToFloat?

While I appreciate your quick answer, a more elaborated answer will be nice.

Oh, I don't know - I don't think this has come up before.

Ok, I got it. There are two functions do just that. Serial.parseInt() and Serial.parseFloat(). I know it is something simply like that. :)

serial input basics