<?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: printf float format like &amp;quot;%0.02f&amp;quot; does not work in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/printf-float-format-like-quot-0-02f-quot-does-not-work/m-p/412522#M13775</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sandro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On MQX for Kinetis when I try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: #7f0055;"&gt;float&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; pi = 3.1415;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: #642880;"&gt;printf&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: #2a00ff;"&gt;"The Pi number is: %2.2f\n"&lt;/SPAN&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;,pi);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: #642880;"&gt;printf&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: #2a00ff;"&gt;"And a tenth of Pi is: %2.2f\n"&lt;/SPAN&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;,pi/10);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got on the terminal:&lt;/P&gt;&lt;P&gt; The Pi number is: 3.14&lt;/P&gt;&lt;P&gt; And a tenth of Pi is: 0.31&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you make a test trying to use %1.2f instead?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Sep 2015 17:25:43 GMT</pubDate>
    <dc:creator>dshimizu</dc:creator>
    <dc:date>2015-09-02T17:25:43Z</dc:date>
    <item>
      <title>printf float format like "%0.02f" does not work</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/printf-float-format-like-quot-0-02f-quot-does-not-work/m-p/412520#M13773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rene,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/message/560857?et=watches.email.thread#560857" title="https://community.freescale.com/message/560857?et=watches.email.thread#560857"&gt;https://community.freescale.com/message/560857?et=watches.email.thread#560857&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;18 months later this discussion, another float format problem was found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still using MQX 4.1.1, with the corrections discussed in this post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the float format "%0.02f" to obtain outputs of type "x.yz".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1- If the number is, for example, 1.234, I get "1.23" ---&amp;gt; that's right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2- If the number is shorter than one and greater than 0.1, for example, 0.123, the output string is "012" (without dot) and not "0.12".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3- If the number is shorter than 0.1, e.g. 0.05, it also works giving an "0.05" string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resuming, the wrong result is for the range:&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.1 &amp;lt;=&amp;nbsp; x &amp;lt; 1.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another workaround or correction I could apply?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you,&lt;/P&gt;&lt;P&gt;sandro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="-1" data-containertype="-1" data-content-finding="Community" data-objectid="207914" data-objecttype="3" href="https://community.nxp.com/people/rendy"&gt;Rene Kolarik&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="-1" data-containertype="-1" data-content-finding="Community" data-objectid="203545" data-objecttype="3" href="https://community.nxp.com/people/karinavalencia"&gt;Karina Valencia Aguilar&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="-1" data-containertype="-1" data-content-finding="Community" data-objectid="15067" data-objecttype="3" href="https://community.nxp.com/people/bfac"&gt;Bruno Castelucci&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 17:41:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/printf-float-format-like-quot-0-02f-quot-does-not-work/m-p/412520#M13773</guid>
      <dc:creator>sandrobastos</dc:creator>
      <dc:date>2015-08-31T17:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: printf float format like "%0.02f" does not work</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/printf-float-format-like-quot-0-02f-quot-does-not-work/m-p/412521#M13774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I will check this and provide a patch soon.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2015 12:05:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/printf-float-format-like-quot-0-02f-quot-does-not-work/m-p/412521#M13774</guid>
      <dc:creator>rendy</dc:creator>
      <dc:date>2015-09-02T12:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: printf float format like "%0.02f" does not work</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/printf-float-format-like-quot-0-02f-quot-does-not-work/m-p/412522#M13775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sandro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On MQX for Kinetis when I try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: #7f0055;"&gt;float&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; pi = 3.1415;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: #642880;"&gt;printf&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: #2a00ff;"&gt;"The Pi number is: %2.2f\n"&lt;/SPAN&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;,pi);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: #642880;"&gt;printf&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: #2a00ff;"&gt;"And a tenth of Pi is: %2.2f\n"&lt;/SPAN&gt;&lt;SPAN lang="PT-BR" style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;,pi/10);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got on the terminal:&lt;/P&gt;&lt;P&gt; The Pi number is: 3.14&lt;/P&gt;&lt;P&gt; And a tenth of Pi is: 0.31&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you make a test trying to use %1.2f instead?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2015 17:25:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/printf-float-format-like-quot-0-02f-quot-does-not-work/m-p/412522#M13775</guid>
      <dc:creator>dshimizu</dc:creator>
      <dc:date>2015-09-02T17:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: printf float format like "%0.02f" does not work</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/printf-float-format-like-quot-0-02f-quot-does-not-work/m-p/412523#M13776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Denis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've just run your example and got a wrong output (the same for "%2.2f" and "%1.2f"):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Pi number is: 3.14&lt;/P&gt;&lt;P&gt;And a tenth of Pi is: 031&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remember I'm using a patched MQX4.1.1 (see the link at the top of this post); maybe the patches are causing this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you and best regards,&lt;/P&gt;&lt;P&gt;sandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2015 17:47:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/printf-float-format-like-quot-0-02f-quot-does-not-work/m-p/412523#M13776</guid>
      <dc:creator>sandrobastos</dc:creator>
      <dc:date>2015-09-02T17:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: printf float format like "%0.02f" does not work</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/printf-float-format-like-quot-0-02f-quot-does-not-work/m-p/412524#M13777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rene,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the old bug, cited in the top link of this post, is still present in MQX 4.2 :(&lt;/P&gt;&lt;P&gt;so we have to apply that patches that brings this new bad behavior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sandro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2015 12:20:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/printf-float-format-like-quot-0-02f-quot-does-not-work/m-p/412524#M13777</guid>
      <dc:creator>sandrobastos</dc:creator>
      <dc:date>2015-09-03T12:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: printf float format like "%0.02f" does not work</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/printf-float-format-like-quot-0-02f-quot-does-not-work/m-p/412525#M13778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having the same problems here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Sep 2015 11:49:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/printf-float-format-like-quot-0-02f-quot-does-not-work/m-p/412525#M13778</guid>
      <dc:creator>kaif</dc:creator>
      <dc:date>2015-09-23T11:49:20Z</dc:date>
    </item>
  </channel>
</rss>

