<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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>How to print floating numbers with nRF Connect SDK?</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/72130/how-to-print-floating-numbers-with-nrf-connect-sdk</link><description>Hello, guys. 
 I am using nRF Connect SDK, version 1.4.2 and nRF52840DK. I wonder what would be the way to print floating numbers during debug phase? 
 According to this thread , all we need is to include the following line into prj.conf file: 
 
 as</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Fri, 21 Jan 2022 13:16:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/72130/how-to-print-floating-numbers-with-nrf-connect-sdk" /><item><title>RE: How to print floating numbers with nRF Connect SDK?</title><link>https://test-devzone.nordicsemi.com/thread/348937?ContentTypeID=1</link><pubDate>Fri, 21 Jan 2022 13:16:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3acd9ed9-bf6d-4bb4-9f50-932628f6af2f</guid><dc:creator>user110364</dc:creator><description>&lt;p&gt;I had a similar issue. Not sure why, but it just won&amp;#39;t print floats. I solved it by converting to char and printing that instead:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;char buf[MAX];
gcvt( THE_FLOAT, 6, buf);//need to import stdio.h
printk(&amp;quot;%s&amp;quot;,buf);
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to print floating numbers with nRF Connect SDK?</title><link>https://test-devzone.nordicsemi.com/thread/296886?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 14:15:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9d37dc1-0229-4e9b-a98d-8d76d09e36fa</guid><dc:creator>user14926</dc:creator><description>&lt;p&gt;&lt;a href="https://test-devzone.nordicsemi.com/members/user76830"&gt;user76830&lt;/a&gt;, I think what &lt;a href="https://test-devzone.nordicsemi.com/members/user6462"&gt;user6462&lt;/a&gt; meant was that &amp;quot;&lt;span&gt;Segger Debug Terminal&amp;quot; only shows logs/prints from RTT interface, while the printf function is normally redirected to the UART serial terminal.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If nothing is printed at all, this does not sound like an issue with printing floats, but rather how you read the logs/prints in general.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I tried adding your printf-line to the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.2/nrf/samples/bluetooth/peripheral_uart/README.html"&gt;BLE UART peripheral sample&lt;/a&gt; in NCS v1.4.2, and it prints the float over UART without any added Kconfigs:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;float tmp = 123.456;
printf(&amp;quot;Floating number: %3.2f\n&amp;quot;, tmp);&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Output in serial terminal:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.4.0-ncs2  ***
Floating number: 123.46
Starting Nordic UART service example&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to print floating numbers with nRF Connect SDK?</title><link>https://test-devzone.nordicsemi.com/thread/296678?ContentTypeID=1</link><pubDate>Sat, 27 Feb 2021 10:22:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87ad8538-30a4-4cbe-9eb3-834d507df250</guid><dc:creator>user76830</dc:creator><description>&lt;p&gt;Hey, &lt;a href="https://test-devzone.nordicsemi.com/members/user6462"&gt;user6462&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Thanks for your reply. Unfortunately, I don&amp;#39;t get floating number printed with&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;printf(&amp;quot;Floating number: %3.2f\n&amp;quot;, tmp);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;even on RTT.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to print floating numbers with nRF Connect SDK?</title><link>https://test-devzone.nordicsemi.com/thread/296675?ContentTypeID=1</link><pubDate>Sat, 27 Feb 2021 09:53:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8d83de3-16bf-4ca5-8bde-d07e236da46e</guid><dc:creator>user6462</dc:creator><description>[quote userid="76830" url="~/f/nordic-q-a/72130/how-to-print-floating-numbers-with-nrf-connect-sdk"]Nothing is printed in my Segger Debug Terminal[/quote]
&lt;p&gt;I think that only does RTT ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>