<?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 keep the value calculated by the formula to only two significant digits after the decimal point? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-keep-the-value-calculated-by-the-formula-to-only-two/m-p/610116#M81109</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/17251"&gt;@lala&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I believe you can achieve that you're after with fewer steps in JSL. Below is a code that formats the new formula column with 2 decimal places. In the command Format("Fixed Dec", w, n), the first number "w" is the width of the field and the second number "n" is the number of digits after the decimal to keep. Not that I did not do the rounding in this example for the formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; In your JSL, you are setting both the width and number of digits after the decimal to 20, so this is why you get the output you see.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here (1);

dt = Open("$Sample_data/Big Class.jmp");
New Column("A", Formula(:height/:weight));
dt:A&amp;lt;&amp;lt;Format("Fixed Dec", 6, 2);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2023 15:03:28 GMT</pubDate>
    <dc:creator>SDF1</dc:creator>
    <dc:date>2023-03-09T15:03:28Z</dc:date>
    <item>
      <title>How do keep the value calculated by the formula to only two significant digits after the decimal point?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-keep-the-value-calculated-by-the-formula-to-only-two/m-p/609942#M81097</link>
      <description>&lt;P&gt;For example, the actual data for a column calculated like this is many digits.How can&amp;nbsp; directly compute something like the last column?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-03-09_10-06-12.png" style="width: 435px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/50880iCD6BD9BB2FB18545/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-03-09_10-06-12.png" alt="2023-03-09_10-06-12.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Column( "A" );
Column( "A" ) &amp;lt;&amp;lt; Formula( Round( height /weight, 2 ) );
dt &amp;lt;&amp;lt; run formulas;
Column( "A" ) &amp;lt;&amp;lt; deleteFormula;
dt &amp;lt;&amp;lt; run formulas;
d2 = dt &amp;lt;&amp;lt; Summary( Group( age ), Max( A ), Freq( "无" ), Weight( "无" ), Link to original data table( 0 ) );
Column( d2, 3 ) &amp;lt;&amp;lt; Format( "Fixed Dec", 20, 20 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jun 2023 16:30:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-keep-the-value-calculated-by-the-formula-to-only-two/m-p/609942#M81097</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-06-08T16:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do keep the value calculated by the formula to only two significant digits after the decimal point?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-keep-the-value-calculated-by-the-formula-to-only-two/m-p/609943#M81098</link>
      <description>I ended up saving table d2 in the actual data, which is huge.</description>
      <pubDate>Thu, 09 Mar 2023 02:12:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-keep-the-value-calculated-by-the-formula-to-only-two/m-p/609943#M81098</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-03-09T02:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do keep the value calculated by the formula to only two significant digits after the decimal point?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-keep-the-value-calculated-by-the-formula-to-only-two/m-p/610116#M81109</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/17251"&gt;@lala&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I believe you can achieve that you're after with fewer steps in JSL. Below is a code that formats the new formula column with 2 decimal places. In the command Format("Fixed Dec", w, n), the first number "w" is the width of the field and the second number "n" is the number of digits after the decimal to keep. Not that I did not do the rounding in this example for the formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; In your JSL, you are setting both the width and number of digits after the decimal to 20, so this is why you get the output you see.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here (1);

dt = Open("$Sample_data/Big Class.jmp");
New Column("A", Formula(:height/:weight));
dt:A&amp;lt;&amp;lt;Format("Fixed Dec", 6, 2);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 15:03:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-keep-the-value-calculated-by-the-formula-to-only-two/m-p/610116#M81109</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2023-03-09T15:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do keep the value calculated by the formula to only two significant digits after the decimal point?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-keep-the-value-calculated-by-the-formula-to-only-two/m-p/610374#M81117</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-03-10_7-14-48.png" style="width: 521px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/50907i0E3A0C235A8E0EC7/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-03-10_7-14-48.png" alt="2023-03-10_7-14-48.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This method is not effective.Thank you for your help!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 23:17:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-keep-the-value-calculated-by-the-formula-to-only-two/m-p/610374#M81117</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-03-09T23:17:31Z</dc:date>
    </item>
  </channel>
</rss>

