<?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 Sprintf and Sscanf can not convert float type data in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/Sprintf-and-Sscanf-can-not-convert-float-type-data/m-p/1159731#M9324</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;i want to use sscanf to convert a string into float ,follow is my code:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;uint8 tt[] = {"$GPRMC,094411.00"};&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;uint8 a;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;float t;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;a = sscanf(tt,"%*[^,],%lf",&amp;amp;t);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;when i compile and debug in S32DS,i found that i can't convert the string into float,i check the value of t,it's equal to 0 instead of 94411.00,when i change the type of t into integer,it can work but only for the integer part of 94411,the same situation appear in sprintf,what should i do to solve this problem?&lt;/P&gt;</description>
    <pubDate>Sun, 27 Sep 2020 12:03:53 GMT</pubDate>
    <dc:creator>leo_liu2</dc:creator>
    <dc:date>2020-09-27T12:03:53Z</dc:date>
    <item>
      <title>Sprintf and Sscanf can not convert float type data</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Sprintf-and-Sscanf-can-not-convert-float-type-data/m-p/1159731#M9324</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;i want to use sscanf to convert a string into float ,follow is my code:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;uint8 tt[] = {"$GPRMC,094411.00"};&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;uint8 a;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;float t;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;a = sscanf(tt,"%*[^,],%lf",&amp;amp;t);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;when i compile and debug in S32DS,i found that i can't convert the string into float,i check the value of t,it's equal to 0 instead of 94411.00,when i change the type of t into integer,it can work but only for the integer part of 94411,the same situation appear in sprintf,what should i do to solve this problem?&lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2020 12:03:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Sprintf-and-Sscanf-can-not-convert-float-type-data/m-p/1159731#M9324</guid>
      <dc:creator>leo_liu2</dc:creator>
      <dc:date>2020-09-27T12:03:53Z</dc:date>
    </item>
  </channel>
</rss>

