<?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>sprintf with SDK 17.1</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87354/sprintf-with-sdk-17-1</link><description>I&amp;#39;m trying to get sprintf working with SDK 17.1. Basically, I&amp;#39;m struggling getting this simply use-case to work. char buf[32]; sprintf(buf, &amp;quot;%.3f&amp;quot;, 3,5); I&amp;#39;m not able to find a flag that enables this support. Any assistant would be greatly appreciated</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Apr 2022 12:44:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87354/sprintf-with-sdk-17-1" /><item><title>RE: sprintf with SDK 17.1</title><link>https://devzone.nordicsemi.com/thread/365197?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2022 12:44:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a1eaf6b-5c94-4246-ac14-980a9d11a980</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which compiler/IDE are you using?&lt;/p&gt;
&lt;p&gt;In Segger Embedded Studio, there is a project option to enable float support for printf:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/ses_5F00_printf_5F00_float.png" /&gt;&lt;/p&gt;
&lt;p&gt;You also likely need to change your &amp;quot;float&amp;quot; from &amp;quot;3,5&amp;quot; to &amp;quot;3.5&amp;quot;, comma is used to separate different parameters.&lt;/p&gt;
&lt;p&gt;I verified that the float in sprintf works in UART peripheral example in SES, with the above option set to &amp;quot;float&amp;quot;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>