<?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>Long long Int value sprintf</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83967/long-long-int-value-sprintf</link><description>Hi, I am working with nrf9160, I want to convert INT64 timestamp value to CHAR array with sprintf. I use %lld but sprintf said only &amp;quot;ld&amp;quot; if I use %ld it convert only low side 32 bit value. I tried printk fonction for print int64 value on screen It is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Jan 2022 08:47:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83967/long-long-int-value-sprintf" /><item><title>RE: Long long Int value sprintf</title><link>https://devzone.nordicsemi.com/thread/349452?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 08:47:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c4e1dbf-afcc-4486-8a6e-59626ab5bd5c</guid><dc:creator>Mmterkc</dc:creator><description>&lt;p&gt;I added&amp;nbsp;&lt;span&gt;CONFIG_NEWLIB_LIBC_NANO&lt;/span&gt;&lt;span&gt;=n. It worked.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Long long Int value sprintf</title><link>https://devzone.nordicsemi.com/thread/349442?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 08:29:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ee5a309-0c25-432b-8bfc-bc8cc07a40c1</guid><dc:creator>Mmterkc</dc:creator><description>&lt;p&gt;Thanks for your answer but&amp;nbsp;&lt;span&gt;CONFIG_NEWLIB_LIBC=y already inside my conf file.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;code: &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;sprintf(timestampChar,&amp;quot;%lld&amp;quot;,timestamp&amp;nbsp;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;printk(&amp;quot;timestampchar:%s&amp;quot;,timestampChar);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;output:&lt;br /&gt;timestampchar:ld&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/members/kazi-afroza-sultana"&gt;Kazi Afroza Sultana&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Long long Int value sprintf</title><link>https://devzone.nordicsemi.com/thread/349317?ContentTypeID=1</link><pubDate>Mon, 24 Jan 2022 14:53:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:044d0941-a653-465d-a692-8ec65756d477</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Mmt,&lt;/p&gt;
&lt;p&gt;Thanks for your query.&lt;/p&gt;
&lt;p&gt;Have you tried to implement a code from sample or build from a scratch? Is the header file included properly?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;you can check this sample&amp;nbsp;&amp;nbsp;.&lt;strong&gt;..\nrf\samples\nrf9160\modem_shell\src\utils&amp;nbsp; modem_shell &lt;/strong&gt;to see how &lt;strong&gt;sprintf&lt;/strong&gt; is used and the configure file (prj.conf) as well.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can check CONFIG_NEWLIB_LIBC=y to make sprintf supports int64 (&lt;a href="https://docs.zephyrproject.org/latest/reference/libc/index.html"&gt;https://docs.zephyrproject.org/latest/reference/libc/index.html&lt;/a&gt;&amp;nbsp;).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please try this and let us know the consequence.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Kazi Afroza Sultana&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>