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

How to display the float value in Cube IDE .

 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.
TDK
TDKBest answer
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""."

2 replies

TDK
TDKBest answer
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