<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[truncate all elements in a list?]]></title><description><![CDATA[<p>Hello forum!</p>
<p>Need a pd wizard to help me. I need to be able to truncate all the floats in a list to a certain decimal point. Or, if we want to be really clever, round these numbers to the nearest (truncated) decimal value.</p>
<p>For example, I need a way to turn <strong>[0.835587 0.16678 0.38896, 54.3221 -4.567776(</strong> into <strong>[0.84 0.17 0.39 54.32 -4.57(</strong>. I'm sure I could spend hours thinking about this but I was wondering if anyone knows of an easy object that does this.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list</link><generator>RSS for Node</generator><lastBuildDate>Sun, 09 Aug 2026 04:12:48 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/9543.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Oct 2015 21:07:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to truncate all elements in a list? on Wed, 07 Oct 2015 21:07:32 GMT]]></title><description><![CDATA[<p>Hello forum!</p>
<p>Need a pd wizard to help me. I need to be able to truncate all the floats in a list to a certain decimal point. Or, if we want to be really clever, round these numbers to the nearest (truncated) decimal value.</p>
<p>For example, I need a way to turn <strong>[0.835587 0.16678 0.38896, 54.3221 -4.567776(</strong> into <strong>[0.84 0.17 0.39 54.32 -4.57(</strong>. I'm sure I could spend hours thinking about this but I was wondering if anyone knows of an easy object that does this.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list</guid><dc:creator><![CDATA[rjp9]]></dc:creator><pubDate>Wed, 07 Oct 2015 21:07:32 GMT</pubDate></item><item><title><![CDATA[Reply to truncate all elements in a list? on Wed, 07 Oct 2015 22:28:27 GMT]]></title><description><![CDATA[<p>I don't know of any object that would do that (and that would be handy!), but you can try something like this:</p>
<p><img src="/uploads/files/1444256829798-screenshot-from-2015-10-08-00-26-41.png" alt="Screenshot from 2015-10-08 00:26:41.png" class="img-responsive img-markdown" /></p>
<p><strong>[int]</strong> and <strong>[wrap]</strong> will first separate the number into integer part and floating point part, respectively. Then a bit of math trickery can do the job <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":)" alt=":)" /></p>
<p>Hope this helps, cheers!<br />
Gilberto</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list/2</guid><dc:creator><![CDATA[gsagostinho]]></dc:creator><pubDate>Wed, 07 Oct 2015 22:28:27 GMT</pubDate></item><item><title><![CDATA[Reply to truncate all elements in a list? on Wed, 07 Oct 2015 23:45:11 GMT]]></title><description><![CDATA[<p>list-round from list-abs, with &quot;.01&quot; sent to the right inlet</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list/3</guid><dc:creator><![CDATA[seb-harmonik.ar]]></dc:creator><pubDate>Wed, 07 Oct 2015 23:45:11 GMT</pubDate></item><item><title><![CDATA[Reply to truncate all elements in a list? on Thu, 08 Oct 2015 02:55:46 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/gsagostinho">@gsagostinho</a> <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/seb-harmonik-ar">@seb-harmonik-ar</a> thanks guys!</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list/4</guid><dc:creator><![CDATA[rjp9]]></dc:creator><pubDate>Thu, 08 Oct 2015 02:55:46 GMT</pubDate></item><item><title><![CDATA[Reply to truncate all elements in a list? on Thu, 08 Oct 2015 02:58:56 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/gsagostinho">@gsagostinho</a> hey really quick question: what's the function of the [mod 10] in your chain? Aren't those numbers already going to be between 0-9? Sorry I don't have access to a computer right now I just wanted to ask before I forgot.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list/5</guid><dc:creator><![CDATA[rjp9]]></dc:creator><pubDate>Thu, 08 Oct 2015 02:58:56 GMT</pubDate></item><item><title><![CDATA[Reply to truncate all elements in a list? on Thu, 08 Oct 2015 10:14:54 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/rjp9">@rjp9</a> Not really, the numbers that interest me are running between 0-9 but there might be other things to discard. E.g.: look at the rightmost part of the code, after the 0.456 has been fed to the <strong>[t f f]</strong>. So it's multiplied by 100, and now we have 45.6, then the <strong>[int]</strong> will make it a 45, and a <strong>[mod 10]</strong> will extract the last digit, in this case 5. Then dividing it by 100 makes it once again a 0.05.</p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/seb-harmonik-ar">@seb-harmonik-ar</a> I didn't know <strong>[list-round]</strong>, thanks for the tip!</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list/6</guid><dc:creator><![CDATA[gsagostinho]]></dc:creator><pubDate>Thu, 08 Oct 2015 10:14:54 GMT</pubDate></item><item><title><![CDATA[Reply to truncate all elements in a list? on Thu, 08 Oct 2015 13:14:22 GMT]]></title><description><![CDATA[<p>Another really useful tool is [list-map], which lets you perform customized operations on a list.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/9543/truncate-all-elements-in-a-list/7</guid><dc:creator><![CDATA[LiamG]]></dc:creator><pubDate>Thu, 08 Oct 2015 13:14:22 GMT</pubDate></item></channel></rss>