<?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: How do I preserve trailing zeros in a list of numbers? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-preserve-trailing-zeros-in-a-list-of-numbers/m-p/230532#M45719</link>
    <description>&lt;P&gt;If you want to retain numeric values, just send the message to the data columnn to set this format.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Oct 2019 13:29:55 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2019-10-24T13:29:55Z</dc:date>
    <item>
      <title>How do I preserve trailing zeros in a list of numbers?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-preserve-trailing-zeros-in-a-list-of-numbers/m-p/230448#M45701</link>
      <description>&lt;P&gt;Hey guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an application where I need to preserve trailing zeroes for numbers within a list when using the round function. I know trailing zeroes can be preserved in column formatting but the numbers I am working with exist outside of a column object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An example below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;list_x = {23.04, 24.12,59.632,87.9913};
rounded_x = {};
for(i = 1, i &amp;lt;= nitems(list_x), i++,
	rounded_x[i] = round(list_x[i], 1);
);

show(rounded_x);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The returned list does not show trailing zeroes&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rounded_x = {23, 24.1, 59.6, 88};&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I looked for ways to force something to a float with specific decimal places but couldnt find anything in the scripting index (at least for the keywords I was using)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 21:20:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-preserve-trailing-zeros-in-a-list-of-numbers/m-p/230448#M45701</guid>
      <dc:creator>cnattrass</dc:creator>
      <dc:date>2019-10-23T21:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I preserve trailing zeros in a list of numbers?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-preserve-trailing-zeros-in-a-list-of-numbers/m-p/230464#M45704</link>
      <description>&lt;P&gt;Landon a coworker of mine and a JMP guru was able to answer the question&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the solution if anyone else had this question&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;list_x = {23.04, 24.12,59.632,87.9913};
rounded_x = {};
for(i = 1, i &amp;lt;= nitems(list_x), i++,
	rounded_x[i] = eval(expr(format(round(list_x[i], 1), "Fixed",1)));
);

show(rounded_x);&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Returns&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rounded_x = {"23.0", "24.1", "59.6", "88.0"};&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 23:09:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-preserve-trailing-zeros-in-a-list-of-numbers/m-p/230464#M45704</guid>
      <dc:creator>cnattrass</dc:creator>
      <dc:date>2019-10-23T23:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I preserve trailing zeros in a list of numbers?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-preserve-trailing-zeros-in-a-list-of-numbers/m-p/230494#M45710</link>
      <description>How can I modify this easily in the context of a much larger "custom list"? For example, N rows of values exported (populated) into a JMP data table Column?</description>
      <pubDate>Thu, 24 Oct 2019 04:47:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-preserve-trailing-zeros-in-a-list-of-numbers/m-p/230494#M45710</guid>
      <dc:creator>PatrickGiuliano</dc:creator>
      <dc:date>2019-10-24T04:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I preserve trailing zeros in a list of numbers?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-preserve-trailing-zeros-in-a-list-of-numbers/m-p/230531#M45718</link>
      <description>&lt;P&gt;The original script returned numeric results from the Round() function. The solution returns character string results from the Format() function.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 13:29:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-preserve-trailing-zeros-in-a-list-of-numbers/m-p/230531#M45718</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-10-24T13:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I preserve trailing zeros in a list of numbers?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-preserve-trailing-zeros-in-a-list-of-numbers/m-p/230532#M45719</link>
      <description>&lt;P&gt;If you want to retain numeric values, just send the message to the data columnn to set this format.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 13:29:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-preserve-trailing-zeros-in-a-list-of-numbers/m-p/230532#M45719</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-10-24T13:29:55Z</dc:date>
    </item>
  </channel>
</rss>

