Arduino Forum
Sprintf() a float number
Projects
Programming
J-M-L
July 17, 2022, 4:45am
2
Try truncating the value
https://m.cplusplus.com/reference/cmath/trunc/
show post in topic
Related topics
Topic
Replies
Views
Activity
Sprintf funktioniert nicht mit floats
Deutsch
9
80
March 19, 2026
sprintf(buff, "%.0f", floatValue)
Deutsch
10
1198
May 6, 2021
So no %f for sprintf.... what's your solution? [SOLUTION]
Programming
26
16617
May 5, 2021
"Round" float to one decimal place for printing to OLED
Programming
11
26849
March 25, 2022
Strange float behaviour on Arduino Mega
Programming
29
388
December 25, 2025