Page 1 of 1

os_sprintf function donot support format parameters for float type

Posted: Thu Sep 24, 2015 11:21 am
by sdylion
Hi,
I want to use os_sprintf function to convert float to string ,why not support "%f" or "%10.3f", the code like this :

measureValue = 23451.123;
os_sprintf( measureValStr, "%f", measureValue );
os_sprintf( tempStr, " kWh");
strcat( measureValStr, tempStr );
os_printf(" measure str is %s \n", measureValStr);


but the result is " %f kWh" , why not support this format ?
I want to use C API sprintf, but compile error
Need your help, thanks.

Re: os_sprintf function donot support format parameters for float type

Posted: Fri Apr 15, 2016 4:05 pm
by berkutta
%X doesnt work to for uppercasse HEX