Forum >Arduino sprintf float not formatting
Arduino sprintf float not formatting

I have this arduino sketch,
char temperature[10]; float temp = 10.55; sprintf(temperature,"%f F", temp); Serial.println(temperature);
temperature prints out as
? F
Any thoughts on how to format this float? I need it to be a char string.
2023-02-25 00:17:06
NeloKin
Hi
Could you please refer to this article? It will show you how to convert float to char.
https://www.quora.com/What-is-the-process-of-converting-float-to-char-in-C
Hope it can help.
