os_sprintf function donot support format parameters for float type

sdylion
Posts: 9
Joined: Thu Sep 24, 2015 11:15 am

os_sprintf function donot support format parameters for float type

Postby sdylion » Thu Sep 24, 2015 11:21 am

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.

berkutta
Posts: 15
Joined: Tue Mar 15, 2016 6:30 pm

Re: os_sprintf function donot support format parameters for float type

Postby berkutta » Fri Apr 15, 2016 4:05 pm

%X doesnt work to for uppercasse HEX

Who is online

Users browsing this forum: No registered users and 8 guests