cancel
Showing results for 
Search instead for 
Did you mean: 

How to display the float value in Cube IDE .

Snara.21
Senior

 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

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Enable float support for printf in project settings.

0693W00000FAjTXQA1.png

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

Enable float support for printf in project settings.

0693W00000FAjTXQA1.png

If you feel a post has answered your question, please click "Accept as Solution".

i enabled this but all 000 got printed after decimal point

what should i do