<?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>nordic implementation of itoa?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7745/nordic-implementation-of-itoa</link><description>I want to convert an integer to a char array and feel like this is something an nRF library may have already implemented. Nothing showed up after an initial search of itoa in the documentation although it is likely to have another name. 
 Does this already</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Jun 2015 06:06:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7745/nordic-implementation-of-itoa" /><item><title>RE: nordic implementation of itoa?</title><link>https://devzone.nordicsemi.com/thread/27583?ContentTypeID=1</link><pubDate>Tue, 23 Jun 2015 06:06:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:978a43e1-35df-4464-9085-0ec8ab09da6a</guid><dc:creator>la-ble</dc:creator><description>&lt;p&gt;Yes, Kiel v5.12.  This still isn&amp;#39;t working for me though and I don&amp;#39;t seem to have an ability to really swap out compilers.  Thank you for your help anyways.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nordic implementation of itoa?</title><link>https://devzone.nordicsemi.com/thread/27584?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2015 15:41:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3a18c31-81ad-4e40-b34a-b31bebdee25c</guid><dc:creator>Nathan</dc:creator><description>&lt;p&gt;I recently had to look into a simple way of converting the device&amp;#39;s built in serial number to a decimal ascii character array. You may find sprintf() in stdio.h to work well enough for your purposes, just provide it a large enough buffer and make sure to use the correct format parameter for your application. For example, below is what I used to convert the unsigned 64 bit hex nordic serial number to a decimal string:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;nrf.h&amp;gt;
#include &amp;quot;nrf_soc.h&amp;quot;
...
int serial_number_string_length;
uint64_t const * const serial_number = (uint64_t const *) &amp;amp;NRF_FICR-&amp;gt;DEVICEID[0];
static char serial_number_string[21]; // Max decimal character length is 20 digits (result of 2^64)
serial_number_string_length = sprintf(serial_number_string, &amp;quot;%llu&amp;quot;, *serial_number);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nordic implementation of itoa?</title><link>https://devzone.nordicsemi.com/thread/27582?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2015 04:53:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec4823c0-f493-4d54-924a-b06beaccd96a</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;You are using Keil I presume.  Try newlib-nano.  I think it should be avail in the version 5.1x.  I have seen some time ago.  I am currently using Eclipse with GCC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nordic implementation of itoa?</title><link>https://devzone.nordicsemi.com/thread/27581?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2015 04:48:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43816023-8dbb-4736-87cf-a837dc42a8af</guid><dc:creator>la-ble</dc:creator><description>&lt;p&gt;In Options for Target, I can see that I&amp;#39;m using &lt;code&gt;MicroLIB&lt;/code&gt;.  Not sure what exactly is the latest new library that you&amp;#39;re referring to.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nordic implementation of itoa?</title><link>https://devzone.nordicsemi.com/thread/27580?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2015 04:18:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f669f40-5901-4eb3-9436-f0da87d5eab7</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Compiled with gcc 4.9&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdlib.h&amp;gt;
        
char buf[10];
itoa(10, buf, 10);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nordic implementation of itoa?</title><link>https://devzone.nordicsemi.com/thread/27579?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2015 04:06:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9d38bc1-c6ba-4079-8199-5f6facb78748</guid><dc:creator>la-ble</dc:creator><description>&lt;p&gt;Can you provide a code snippet?  Including &lt;code&gt;&amp;lt;stdlib.h&amp;gt;&lt;/code&gt; doesn&amp;#39;t seem to give me an &lt;code&gt;itoa&lt;/code&gt;.  &lt;code&gt;itoa declared implicitly&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nordic implementation of itoa?</title><link>https://devzone.nordicsemi.com/thread/27578?ContentTypeID=1</link><pubDate>Sun, 21 Jun 2015 18:32:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6cedf9a7-1c93-40b3-9b08-a2471c53a94d</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;It is already part of the standard C lib.  It&amp;#39;s in the newlib that comes with the compiler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>