<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>C++ to_string float</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/101090/c-to_string-float</link><description>I simply want to convert a float into a string or at least a char array. However I always get wrong returns. For example the length is over 150000 while I want to convert 3.3... For integer to_string works great. But not floating points.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 24 Jun 2023 19:36:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/101090/c-to_string-float" /><item><title>RE: C++ to_string float</title><link>https://devzone.nordicsemi.com/thread/432802?ContentTypeID=1</link><pubDate>Sat, 24 Jun 2023 19:36:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78849f02-d927-48d9-8883-bb3663ba62b7</guid><dc:creator>HorstvanGrass</dc:creator><description>&lt;p&gt;Add &lt;code&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_NEWLIB_LIBC=y CONFIG_NEWLIB_LIBC_NANO=n&lt;/pre&gt; to the project file, even if zephyr tells it is obsolete. Fix all bugs.&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: C++ to_string float</title><link>https://devzone.nordicsemi.com/thread/432571?ContentTypeID=1</link><pubDate>Thu, 22 Jun 2023 16:43:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0672e81a-b698-475b-99f9-ae048be2096c</guid><dc:creator>HorstvanGrass</dc:creator><description>&lt;p&gt;This is my project conf file&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_LOG=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_SENSOR_LOG_LEVEL_DBG=y
CONFIG_CBPRINTF_FP_SUPPORT=y

# Bluetooth LE
CONFIG_BT=y

CONFIG_BT_PERIPHERAL=y
CONFIG_BT_NUS=y
CONFIG_BT_DEVICE_NAME=&amp;quot;MY_LBS1&amp;quot;
CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=2048
CONFIG_DEBUG_THREAD_INFO=y
CONFIG_NO_OPTIMIZATIONS=y

### C++ ###
CONFIG_LOG_BACKEND_UART=y

CONFIG_STD_CPP20=y
CONFIG_CPP_MAIN=y

CONFIG_CPLUSPLUS=y
CONFIG_LIB_CPLUSPLUS=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The minimal c++ is not found by the following line&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_MINIMAL_LIBCPP=y
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: C++ to_string float</title><link>https://devzone.nordicsemi.com/thread/432552?ContentTypeID=1</link><pubDate>Thu, 22 Jun 2023 13:49:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e484c00-eb75-42e8-a6a8-9ab6e688401c</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;How are you enabling C++ support in the project? What C++ libraries have you enabled? I am not sure if for instance the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_MINIMAL_LIBCPP"&gt;Minimal C++ Library&lt;/a&gt; supports to_string for floating point numbers.&lt;/p&gt;
&lt;p&gt;Also, do you get any warnings when building the project?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>