<?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>Sscanf &amp;quot;double&amp;quot; failed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69864/sscanf-double-failed</link><description>Hi Currently I want to get Double value from a Char array, but somehow when printing the Double variable, the value returns NULL. 
 double Val_double; char testdou[] = &amp;quot;7777.00000&amp;quot;; sscanf(testdou,&amp;quot;%lf&amp;quot;,&amp;amp; Val_double ); printf(&amp;quot;+++++++++++ %lf +++++++</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Jan 2021 03:53:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69864/sscanf-double-failed" /><item><title>RE: Sscanf "double" failed</title><link>https://devzone.nordicsemi.com/thread/291633?ContentTypeID=1</link><pubDate>Thu, 28 Jan 2021 03:53:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc753b8c-06df-49f1-b6bb-4c98876a22da</guid><dc:creator>MQ_Question</dc:creator><description>&lt;p&gt;Thank you for the suggestion!&lt;/p&gt;
&lt;div style="height:13.6364px;left:7.99716px;position:absolute;top:7.99716px;width:63.6989px;" id="gtx-anchor"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble gtx-bubble" style="left:25px;top:32px;"&gt;
&lt;div class="jfk-bubble-content-id" id="bubble-2"&gt;
&lt;div id="gtx-host"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="jfk-bubble-closebtn-id jfk-bubble-closebtn"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble-arrow-id jfk-bubble-arrow jfk-bubble-arrowup" style="left:32px;"&gt;
&lt;div class="jfk-bubble-arrowimplbefore"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble-arrowimplafter"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sscanf "double" failed</title><link>https://devzone.nordicsemi.com/thread/291631?ContentTypeID=1</link><pubDate>Thu, 28 Jan 2021 03:50:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7b490cc-2dfb-42da-a996-587c579ed3e1</guid><dc:creator>MQ_Question</dc:creator><description>&lt;p&gt;Thank you, I have tried to re-enable Scanf floating point support in project settings. And successfully used sscanf to get the float double.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sscanf "double" failed</title><link>https://devzone.nordicsemi.com/thread/287023?ContentTypeID=1</link><pubDate>Thu, 31 Dec 2020 02:00:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f807f7d-e16a-43e6-bf3a-84885b5fc255</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;What&amp;#39;s kind of error? If you just want to show the float or double type data. You may transfer it to integer. EX: 3.141*1000=3141&amp;nbsp; int&amp;nbsp; x1=3141/1000 int x2=3141%1000 printf(&amp;quot;%d.%03d&amp;quot;,x1,x2);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sscanf "double" failed</title><link>https://devzone.nordicsemi.com/thread/287022?ContentTypeID=1</link><pubDate>Thu, 31 Dec 2020 01:31:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a0235b7-a7ea-404b-8da0-c909e4704890</guid><dc:creator>MQ_Question</dc:creator><description>&lt;p&gt;I&amp;nbsp;&lt;span&gt;enabled printf double point support in the project settings. but but the project error.&lt;/span&gt;&lt;/p&gt;
&lt;div style="height:14px;left:343px;position:absolute;top:8px;width:62.9062px;" id="gtx-anchor"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble gtx-bubble" style="left:-175px;top:32px;"&gt;
&lt;div class="jfk-bubble-content-id" id="bubble-3"&gt;
&lt;div id="gtx-host"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="jfk-bubble-closebtn-id jfk-bubble-closebtn"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble-arrow-id jfk-bubble-arrow jfk-bubble-arrowup" style="left:366.5px;"&gt;
&lt;div class="jfk-bubble-arrowimplbefore"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble-arrowimplafter"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sscanf "double" failed</title><link>https://devzone.nordicsemi.com/thread/286698?ContentTypeID=1</link><pubDate>Mon, 28 Dec 2020 13:12:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1890ca4f-ecd2-4398-964e-764052cec615</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Have you enabled printf floating point support in the project settings? SES will then set the appropriate linker flag.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1609161320810v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sscanf "double" failed</title><link>https://devzone.nordicsemi.com/thread/286561?ContentTypeID=1</link><pubDate>Thu, 24 Dec 2020 11:24:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdfc0259-4ce0-4aee-bb49-5964e76946f2</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;So that&amp;#39;s the display problems. Because your double type value is correct. The compiler option. You may find out the SES C manual.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sscanf "double" failed</title><link>https://devzone.nordicsemi.com/thread/286557?ContentTypeID=1</link><pubDate>Thu, 24 Dec 2020 09:50:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:487a34e3-b2c0-49df-b143-346bea4c2aaf</guid><dc:creator>MQ_Question</dc:creator><description>&lt;p&gt;It doesn&amp;#39;t seem to be able to display Val_dou&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1608803367579v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sscanf "double" failed</title><link>https://devzone.nordicsemi.com/thread/286551?ContentTypeID=1</link><pubDate>Thu, 24 Dec 2020 09:45:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e4407cc-eece-4864-9b76-e201dc97f458</guid><dc:creator>MQ_Question</dc:creator><description>&lt;p&gt;how to add &amp;quot;LDFLAGS + = -u _scanf_float&amp;quot; to SEG C&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sscanf "double" failed</title><link>https://devzone.nordicsemi.com/thread/286550?ContentTypeID=1</link><pubDate>Thu, 24 Dec 2020 09:44:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdc110cc-7b49-4fd3-98f7-c0d754559b7d</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;So how about the watch window value in testdou?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sscanf "double" failed</title><link>https://devzone.nordicsemi.com/thread/286549?ContentTypeID=1</link><pubDate>Thu, 24 Dec 2020 09:42:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c14303ec-7aa1-405d-95aa-bf7dd3543ff6</guid><dc:creator>MQ_Question</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1608802916766v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sscanf "double" failed</title><link>https://devzone.nordicsemi.com/thread/286547?ContentTypeID=1</link><pubDate>Thu, 24 Dec 2020 09:30:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08afd465-bd5a-47df-9bf2-214bed077803</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;Display problems?....&lt;/p&gt;
&lt;p&gt;I am not sure. Because my code result is like this.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1608802223956v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;The value is correct!&lt;/p&gt;
&lt;p&gt;in gcc SES C&lt;/p&gt;
&lt;p&gt;remeber to add on compiler flag&lt;/p&gt;
&lt;p&gt;&lt;span&gt;LDFLAGS += -u _scanf_float&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;if you use sscanf(); function&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sscanf "double" failed</title><link>https://devzone.nordicsemi.com/thread/286544?ContentTypeID=1</link><pubDate>Thu, 24 Dec 2020 08:58:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c12c85f5-04fc-4f22-9fdb-bff8efc7bc6f</guid><dc:creator>MQ_Question</dc:creator><description>&lt;p&gt;I have tried it but with no success.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;printf :&amp;nbsp; &amp;nbsp;&amp;nbsp;+++++++++++&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ++++++++++&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sscanf "double" failed</title><link>https://devzone.nordicsemi.com/thread/286543?ContentTypeID=1</link><pubDate>Thu, 24 Dec 2020 07:59:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4721ae19-e349-460b-88b4-ca7fc0c32bf2</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;char *pEnd;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Val_double=&lt;/span&gt;strtod(testdou,&amp;amp;pEnd);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>