Forum: System Workbench for STM32

Snprintf of float does not work.

Hi,

Same as in the title. Snprintf doesn’t print out float to the buffer instead it finishes the string with \0 just before the %0.2f value.

I am using linker flags: -specs=nosys.specs -z muldefs -u _printf_float -u _sprintf_float -u _snprintf_float
This is the snprintf: snprintf( cbuf, dataLength, “{ "t": "%0.2f", "h": "%0.2f" }”, t, h );

Regards