<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — Convert a float to a string]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=957</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=957&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Convert a float to a string.]]></description>
		<lastBuildDate>Fri, 23 Oct 2020 18:14:20 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Convert a float to a string]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3434#p3434</link>
			<description><![CDATA[<p>Hi Robin</p><p>I have been dealing with &quot;Read buffer overflow&quot;. No real idea, where it is sudenly coming from. </p><p>Can&#039;t you post an exemple please?</p><p>Up to now my past versions were running well and I cannot understand what I did wrong to make RemoteXY unhappy adding a new page where all looks really fine.</p><p>Thanks.</p><p>Kissinno</p>]]></description>
			<author><![CDATA[null@example.com (KissInno)]]></author>
			<pubDate>Fri, 23 Oct 2020 18:14:20 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3434#p3434</guid>
		</item>
		<item>
			<title><![CDATA[Re: Convert a float to a string]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2771#p2771</link>
			<description><![CDATA[<p>Guillaume,</p><p><strong>THANK YOU</strong>. Sorry for shouting, but I am happy.</p><p>I had a problem with the design in the editor. Now that I have sorted that out, it works.</p><p>Thank you also for the warning about buffer overflow as -127.0 is measured if the probe becomes disconnected. I have trapped this and change the string to &quot;ERROR&quot;</p><p>Robin<br /><img src="https://forum.remotexy.com/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p>]]></description>
			<author><![CDATA[null@example.com (Robin)]]></author>
			<pubDate>Wed, 01 Apr 2020 07:46:02 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2771#p2771</guid>
		</item>
		<item>
			<title><![CDATA[Re: Convert a float to a string]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2764#p2764</link>
			<description><![CDATA[<p>Welcome,</p><p>You can use function dtostrf to convert float to string, then function strcat to add the &quot;°C&quot; behind, or you can simply use function sprintf:</p><div class="codebox"><pre><code>float val = 12.3456789;
char str[8]; // buffer to hold string &quot;-XX.X°C\0&quot;

dtostrf( val, 5, 1, str );
strcat( str, &quot;°C&quot; );

// or

sprintf( str, &quot;%.1f°C&quot;, val );</code></pre></div><p>The downside of sprintf is, it uses a lot (1 to 2kB IIRC) of program space.</p><p>And to avoid buffer overflow if temperature sensor gives an incorrect reading like 12345°C (IDK if it&#039;s even possible),&nbsp; you must check if the temperature is in a range that can fit inside the buffer (so -99 to 999, less than 4 characters in front of the dot), or increase buffer size.</p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Tue, 31 Mar 2020 15:29:06 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2764#p2764</guid>
		</item>
		<item>
			<title><![CDATA[Convert a float to a string]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=2763#p2763</link>
			<description><![CDATA[<p>Sorry if this is simple, I am a real beginner here.</p><p>I am using an Arduino. I have a float T (a temperature from a DS18B20).</p><p>I want to display it in the form <strong>XX.X°C</strong>.</p><p>I am missing something simple, but I don&#039;t have much hair to pull out, please help me save what little I have left.</p><p>Thank you.</p>]]></description>
			<author><![CDATA[null@example.com (Robin)]]></author>
			<pubDate>Tue, 31 Mar 2020 15:04:13 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=2763#p2763</guid>
		</item>
	</channel>
</rss>
