Skip to main content
Snara.21
Senior
September 28, 2021
Solved

How to display the float value in Cube IDE .

  • September 28, 2021
  • 1 reply
  • 9109 views

 I am using Sprintf, but I cant see the number in UART

 LPS22HH_pressure=LPS22HH_GetPressure();

  sprintf(result,"%4.2f", LPS22HH_pressure); // @suppress("Float formatting support")

I have also tried %g

This topic has been closed for replies.
Best answer by TDK

Enable float support for printf in project settings.

0693W00000FAjTXQA1.png

1 reply

TDK
TDKBest answer
Super User
September 28, 2021

Enable float support for printf in project settings.

0693W00000FAjTXQA1.png

"If you feel a post has answered your question, please click ""Accept as Solution""."
Visitor II
July 15, 2023

i enabled this but all 000 got printed after decimal point

what should i do