<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to convert float numbers to a cstring? in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166820#M3071</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks kef,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That seems to work for the most part...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I've spent a bit of time looking over the formatting options,&amp;nbsp;I've managed to get it to output whats inside the format string... all except for the floating point number that is!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;char cString[64]; // String bufferint n; // Size of string in the bufferfloat x; // Test numbervoid main(void){  MCUinit(); // Initialize device  SCI1CR2 |= SCI1CR2_TE_MASK // Enable Xmit  x = 1.2345;  n = sprintf( cString, "The number is %g.", x);  putString(cString); // Use recursion to output over SCI1  asm(SWI);  // Halt program and return to BDM}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried different % flags and options, but didn't get anything. cString still has only "The number is ."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:14:17 GMT</pubDate>
    <dc:creator>AirDragon</dc:creator>
    <dc:date>2020-10-29T09:14:17Z</dc:date>
    <item>
      <title>How to convert float numbers to a cstring?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166818#M3069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CW 5.9.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My project is doing quite well so far, but I need to extract the data from the MCU so that it can be manipulated on in MS Excell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To do this, I've decided to convert the data into a character string, and then send it over the SCI module into HyperTerm for extraction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I have been searching for a standard C function that will do something like this, but so far I've only come up with printf.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a notion that I'll probably end up doing this manually, though...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2011 01:16:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166818#M3069</guid>
      <dc:creator>AirDragon</dc:creator>
      <dc:date>2011-09-14T01:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert float numbers to a cstring?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166819#M3070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what about sprintf ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2011 03:44:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166819#M3070</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2011-09-14T03:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert float numbers to a cstring?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166820#M3071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks kef,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That seems to work for the most part...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I've spent a bit of time looking over the formatting options,&amp;nbsp;I've managed to get it to output whats inside the format string... all except for the floating point number that is!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;char cString[64]; // String bufferint n; // Size of string in the bufferfloat x; // Test numbervoid main(void){  MCUinit(); // Initialize device  SCI1CR2 |= SCI1CR2_TE_MASK // Enable Xmit  x = 1.2345;  n = sprintf( cString, "The number is %g.", x);  putString(cString); // Use recursion to output over SCI1  asm(SWI);  // Halt program and return to BDM}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried different % flags and options, but didn't get anything. cString still has only "The number is ."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:14:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166820#M3071</guid>
      <dc:creator>AirDragon</dc:creator>
      <dc:date>2020-10-29T09:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert float numbers to a cstring?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166821#M3072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey kef, figured out that I forgot to include a library that actualy supports floating point. &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2011 09:16:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166821#M3072</guid>
      <dc:creator>AirDragon</dc:creator>
      <dc:date>2011-09-14T09:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert float numbers to a cstring?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166822#M3073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps &lt;A __default_attr="95044" class="jive_macro jive_macro_thread default_title" href="https://community.freescale.com/thread/95044" jivemacro="thread" title="this"&gt;this&lt;/A&gt; thread may also be of interest if the size of the sprinf function should become problematic.&amp;nbsp; The associated binary-to-numeric ASCII conversion&amp;nbsp;process was then discussed &lt;A __default_attr="94838" class="jive_macro jive_macro_thread default_title" href="https://community.freescale.com/thread/94838" jivemacro="thread" title="here"&gt;here&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2011 22:26:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166822#M3073</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2011-09-14T22:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert float numbers to a cstring?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166823#M3074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks, bigmac!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That'll definantly come in handy when I get around to making the project use fixed point arithmetic...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2011 02:10:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166823#M3074</guid>
      <dc:creator>AirDragon</dc:creator>
      <dc:date>2011-09-23T02:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert float numbers to a cstring?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166824#M3075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi AirDragon,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;I have exactly the same problem. I can not convert float data to string by &lt;STRONG&gt;sprintf&lt;/STRONG&gt; function. what library did you include to your project? I added &lt;STRONG&gt;float.h&lt;/STRONG&gt; but didn't help!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 03:02:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-convert-float-numbers-to-a-cstring/m-p/166824#M3075</guid>
      <dc:creator>amleng</dc:creator>
      <dc:date>2012-05-10T03:02:31Z</dc:date>
    </item>
  </channel>
</rss>

