ESP8266 Developer Zone The Official ESP8266 Forum 2016-04-15T16:05:07+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=1147 2016-04-15T16:05:07+08:00 2016-04-15T16:05:07+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1147&p=6481#p6481 <![CDATA[Re: os_sprintf function donot support format parameters for float type]]> Statistics: Posted by berkutta — Fri Apr 15, 2016 4:05 pm


]]>
2015-09-24T11:21:55+08:00 2015-09-24T11:21:55+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1147&p=3832#p3832 <![CDATA[os_sprintf function donot support format parameters for float type]]> 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.

Statistics: Posted by sdylion — Thu Sep 24, 2015 11:21 am


]]>