<?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: Formatting numbers in a loop in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Formatting-numbers-in-a-loop/m-p/773729#M95505</link>
    <description>&lt;P&gt;Thanks for your clarification on that.&lt;BR /&gt;&lt;BR /&gt;I was looking to display some long float numbers in an outline box. I needed to shorten the length of the number.&lt;BR /&gt;I found that Left(Char(:mycolumn), 5); is better suited for my case and I don't lose any precision.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jul 2024 22:04:42 GMT</pubDate>
    <dc:creator>aharro</dc:creator>
    <dc:date>2024-07-17T22:04:42Z</dc:date>
    <item>
      <title>Formatting numbers in a loop</title>
      <link>https://community.jmp.com/t5/Discussions/Formatting-numbers-in-a-loop/m-p/772995#M95375</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm formatting decimal numbers in a loop, and it works on the first row but the 2nd row and thereafter it throws a type error&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;		for each row(my_data,
		
			:my_col = Format( :my_col, "Fixed Dec", 16, 3, "Use thousands separator");
		);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Error: &amp;lt;Column "my_col" changed to type Character to match formula.&amp;gt;&lt;BR /&gt;&lt;BR /&gt;First row everything formats fine but I can't seem to figure out why it fails after.&lt;BR /&gt;&lt;BR /&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 09:52:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formatting-numbers-in-a-loop/m-p/772995#M95375</guid>
      <dc:creator>aharro</dc:creator>
      <dc:date>2024-07-15T09:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting numbers in a loop</title>
      <link>https://community.jmp.com/t5/Discussions/Formatting-numbers-in-a-loop/m-p/773006#M95377</link>
      <description>&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/date-and-time-functions.shtml?os=win&amp;amp;source=application#ww6742865" target="_blank" rel="noopener"&gt;Format()&lt;/A&gt; returns a string (or "quoted format"), so on first row you still have number which you use as input. Then JMP converts all the values to characters in the column -&amp;gt; no more number&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(2),
	Compress File When Saved(1),
	New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2]))
);

For Each Row(dt,
	show(type(:"Column 1"n));
	:"Column 1"n = Format(:"Column 1"n, "Fixed Dec", 16, 3, "Use thousands separator")
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Jul 2024 10:15:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formatting-numbers-in-a-loop/m-p/773006#M95377</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-15T10:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting numbers in a loop</title>
      <link>https://community.jmp.com/t5/Discussions/Formatting-numbers-in-a-loop/m-p/773007#M95378</link>
      <description>&lt;P&gt;Also there should be no need to do this in a loop as you can just change the column properties (unless you want to possibly lose some precision, then you might want to loop)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table("Untitled"):Column 1 &amp;lt;&amp;lt; Format(
	"Fixed Dec",
	Use thousands separator(1),
	13,
	3
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Jul 2024 10:24:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formatting-numbers-in-a-loop/m-p/773007#M95378</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-15T10:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting numbers in a loop</title>
      <link>https://community.jmp.com/t5/Discussions/Formatting-numbers-in-a-loop/m-p/773729#M95505</link>
      <description>&lt;P&gt;Thanks for your clarification on that.&lt;BR /&gt;&lt;BR /&gt;I was looking to display some long float numbers in an outline box. I needed to shorten the length of the number.&lt;BR /&gt;I found that Left(Char(:mycolumn), 5); is better suited for my case and I don't lose any precision.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 22:04:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formatting-numbers-in-a-loop/m-p/773729#M95505</guid>
      <dc:creator>aharro</dc:creator>
      <dc:date>2024-07-17T22:04:42Z</dc:date>
    </item>
  </channel>
</rss>

