<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: query re. displaying floats</title>
		<atom:link href="http://cycling74.com/forums/topic/query-re-displaying-floats/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/query-re-displaying-floats/feed</link>
		<description></description>
		<pubDate>Thu, 20 Jun 2013 05:43:06 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-33876</guid>
					<title><![CDATA[query re. displaying floats]]></title>
					<link>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-33876</link>
					<pubDate>Fri, 28 Sep 2007 17:44:34 +0000</pubDate>
					<dc:creator>robin</dc:creator>

					<description>
						<![CDATA[
						<p>hi</p>
<p>i have an interface built wth lcd on which i want to display float values which i&#8217;ve rounded to 2 decimal places &#8211; ie, 0.777000 becomes 0.780000, but i don&#8217;t want the extra zeros &#8211; i only want to  display 0.78. anyone any idea on how i do this?</p>
<p>thanks</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113372</guid>
					<title><![CDATA[Re: query re. displaying floats]]></title>
					<link>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113372</link>
					<pubDate>Fri, 28 Sep 2007 18:06:45 +0000</pubDate>
					<dc:creator>mzed</dc:creator>

					<description>
						<![CDATA[
						<p>Quote: robin wrote on Fri, 28 September 2007 10:44<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
> hi<br />
> <br />
> i have an interface built wth lcd on which i want to display float values which i&#8217;ve rounded to 2 decimal places &#8211; ie, 0.777000 becomes 0.780000, but i don&#8217;t want the extra zeros &#8211; i only want to  display 0.78. anyone any idea on how i do this?<br />
> <br />
> thanks<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>[sprintf %.2f]</p>
<p>Make sure that you keep the output of the sprintf as a symbol.  Max will try to convert it to a float, if possible, and you&#8217;ll loose your formatting.</p>
<p>mz</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113373</guid>
					<title><![CDATA[Re: query re. displaying floats]]></title>
					<link>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113373</link>
					<pubDate>Fri, 28 Sep 2007 18:09:19 +0000</pubDate>
					<dc:creator>robin</dc:creator>

					<description>
						<![CDATA[
						<p>brilliant&#8230;i&#8217;d just turned to sprintf, but hadn&#8217;t got so far as that.</p>
<p>thanks a lot</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113374</guid>
					<title><![CDATA[Re: query re. displaying floats]]></title>
					<link>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113374</link>
					<pubDate>Fri, 28 Sep 2007 18:13:13 +0000</pubDate>
					<dc:creator>robin</dc:creator>

					<description>
						<![CDATA[
						<p>uh&#8230;actually, that doesn&#8217;t appear to work. it still gives 4 decimal places &#8211; if i feed it 0.12 i get 0.1200 out, even as a symbol</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113375</guid>
					<title><![CDATA[Re: query re. displaying floats]]></title>
					<link>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113375</link>
					<pubDate>Fri, 28 Sep 2007 18:43:34 +0000</pubDate>
					<dc:creator>Jeff Kaiser</dc:creator>

					<description>
						<![CDATA[
						<p>Works here&#8230;</p>
<p>[sprintf symout %.2f]</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113376</guid>
					<title><![CDATA[Re: query re. displaying floats]]></title>
					<link>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113376</link>
					<pubDate>Fri, 28 Sep 2007 18:46:30 +0000</pubDate>
					<dc:creator>mzed</dc:creator>

					<description>
						<![CDATA[
						<p>Quote: robin wrote on Fri, 28 September 2007 11:13<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
> uh&#8230;actually, that doesn&#8217;t appear to work. it still gives 4 decimal places &#8211; if i feed it 0.12 i get 0.1200 out, even as a symbol<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Max is aggressive about converting&#8230; looks like LCD is changing it back to a float.  If you add a blank character at the end it should work.</p>
<p>Try:</p>
<p>#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P newex 179 100 60 196617 loadmess 8;<br />
#P newex 144 166 30 196617 t s b;<br />
#P message 164 193 97 196617 clear , moveto 5 20;<br />
#P user lcd 144 264 49 34 1 1 0 0 0;<br />
#P newex 144 144 108 196617 sprintf write %.2f%c;<br />
#P flonum 144 67 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P connect 5 0 1 1;<br />
#P connect 0 0 1 0;<br />
#P connect 1 0 4 0;<br />
#P connect 4 1 3 0;<br />
#P connect 4 0 2 0;<br />
#P connect 3 0 2 0;<br />
#P window clipboard copycount 6;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113377</guid>
					<title><![CDATA[Re: query re. displaying floats]]></title>
					<link>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113377</link>
					<pubDate>Fri, 28 Sep 2007 18:57:01 +0000</pubDate>
					<dc:creator>Emmanuel Jourdan</dc:creator>

					<description>
						<![CDATA[
						<p>On 28 sept. 07, at 20:46, mzed wrote:</p>
<p>><br />
> Quote: robin wrote on Fri, 28 September 2007 11:13<br />
> &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
>> uh&#8230;actually, that doesn&#8217;t appear to work. it still gives 4  <br />
>> decimal places &#8211; if i feed it 0.12 i get 0.1200 out, even as a symbol<br />
> &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
><br />
> Max is aggressive about converting&#8230; looks like LCD is changing it  <br />
> back to a float.  If you add a blank character at the end it should  <br />
> work.</p>
<p>It&#8217;s because you need to output a symbol from sprintf, and then  <br />
prepend by &#8220;write&#8221;.</p>
<p>ej</p>
<p>#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P newex 144 217 73 196617 prepend write;<br />
#P newex 144 166 30 196617 t s b;<br />
#P message 164 193 97 196617 clear , moveto 5 20;<br />
#P user lcd 144 264 49 34 1 1 0 0 0;<br />
#P newex 144 144 102 196617 sprintf symout %.2f;<br />
#P flonum 144 67 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P connect 5 0 2 0;<br />
#P connect 4 0 5 0;<br />
#P connect 1 0 4 0;<br />
#P connect 0 0 1 0;<br />
#P connect 3 0 2 0;<br />
#P connect 4 1 3 0;<br />
#P window clipboard copycount 6;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113378</guid>
					<title><![CDATA[Re: query re. displaying floats]]></title>
					<link>http://cycling74.com/forums/topic/query-re-displaying-floats/#post-113378</link>
					<pubDate>Fri, 28 Sep 2007 19:12:13 +0000</pubDate>
					<dc:creator>robin</dc:creator>

					<description>
						<![CDATA[
						<p>lovely. thanks guys.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

