<?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: Rounding up to the third decimal place in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rounding-up-to-the-third-decimal-place/m-p/632454#M35696</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/294717"&gt;@shaymo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Welcome to the community!&lt;/P&gt;
&lt;P&gt;Here is a suggestion to round up everytime:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let decimal = 1000;

data have;
	var1_notrounded = (17/30)*&amp;amp;decimal.;
	var1 = ceil(var1_notrounded) / &amp;amp;decimal.;
	var2_notrounded = (1/30)*&amp;amp;decimal.;
	var2 = ceil(var2_notrounded) / &amp;amp;decimal.;
	var3_notrounded = INPUT(t1.'QUANTITY LIMIT AMOUNT'n, best10.)/INPUT(t1.'QUANTITY LIMIT DAYS'n, best10.)*&amp;amp;decimal.;
	var3 = ceil(var3_notrounded) / &amp;amp;decimal.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Best,&lt;/P&gt;</description>
    <pubDate>Mon, 16 Mar 2020 15:15:06 GMT</pubDate>
    <dc:creator>ed_sas_member</dc:creator>
    <dc:date>2020-03-16T15:15:06Z</dc:date>
    <item>
      <title>Rounding up to the third decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rounding-up-to-the-third-decimal-place/m-p/632451#M35694</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to know if SAS EG has the capabilities of rounding up to the third decimal place if there is a fourth numeric value when doing the division?&amp;nbsp; I understand the round/ceil/floor functions but I'm not getting the expected results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;17/30 = .5666666666666667 = output = .567 (correct)&lt;/P&gt;&lt;P&gt;1/30 = .03333333333333 = output = .033 (incorrect) wanting output to be .034&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand the ROUND function is working properly but I'm needing the third decimal to round up if there is&amp;nbsp;a 4th value period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is currently what is coded:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ROUND(((INPUT(t1.'QUANTITY LIMIT AMOUNT'n, best10.))/(INPUT(t1.'QUANTITY LIMIT DAYS'n, best10.))),0.001&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Mar 2020 14:55:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rounding-up-to-the-third-decimal-place/m-p/632451#M35694</guid>
      <dc:creator>shaymo</dc:creator>
      <dc:date>2020-03-16T14:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding up to the third decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rounding-up-to-the-third-decimal-place/m-p/632453#M35695</link>
      <description>&lt;P&gt;Ignoring all of the INPUT stuff try:&lt;/P&gt;
&lt;PRE&gt;(ceil(round( 1/30 ,0.0001)*1000))/1000&lt;/PRE&gt;
&lt;P&gt;CEIL and FLOOR result in integer values, so you need to do the decimal positioning manually when using a non-standard "rounding" approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 15:14:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rounding-up-to-the-third-decimal-place/m-p/632453#M35695</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-16T15:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding up to the third decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rounding-up-to-the-third-decimal-place/m-p/632454#M35696</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/294717"&gt;@shaymo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Welcome to the community!&lt;/P&gt;
&lt;P&gt;Here is a suggestion to round up everytime:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let decimal = 1000;

data have;
	var1_notrounded = (17/30)*&amp;amp;decimal.;
	var1 = ceil(var1_notrounded) / &amp;amp;decimal.;
	var2_notrounded = (1/30)*&amp;amp;decimal.;
	var2 = ceil(var2_notrounded) / &amp;amp;decimal.;
	var3_notrounded = INPUT(t1.'QUANTITY LIMIT AMOUNT'n, best10.)/INPUT(t1.'QUANTITY LIMIT DAYS'n, best10.)*&amp;amp;decimal.;
	var3 = ceil(var3_notrounded) / &amp;amp;decimal.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 15:15:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rounding-up-to-the-third-decimal-place/m-p/632454#M35696</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-03-16T15:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding up to the third decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rounding-up-to-the-third-decimal-place/m-p/632469#M35697</link>
      <description>&lt;P&gt;You could round and if the value went down add 0.001.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input x;
  y=round(x,0.001)+0.001*(round(x,0.001)&amp;lt;x);
cards;
.566667
.333333
;
proc print;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Mar 2020 15:49:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rounding-up-to-the-third-decimal-place/m-p/632469#M35697</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-16T15:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding up to the third decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rounding-up-to-the-third-decimal-place/m-p/632475#M35698</link>
      <description>&lt;P&gt;Thank you so much!!&amp;nbsp; It works beautifully!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 16:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rounding-up-to-the-third-decimal-place/m-p/632475#M35698</guid>
      <dc:creator>shaymo</dc:creator>
      <dc:date>2020-03-16T16:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding up to the third decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rounding-up-to-the-third-decimal-place/m-p/632476#M35699</link>
      <description>&lt;P&gt;Thank you for the response!&amp;nbsp; This could also work but I'm real new to SAS EG and honestly don't know how to code per your example.&amp;nbsp; Appreciate your help!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 16:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Rounding-up-to-the-third-decimal-place/m-p/632476#M35699</guid>
      <dc:creator>shaymo</dc:creator>
      <dc:date>2020-03-16T16:09:10Z</dc:date>
    </item>
  </channel>
</rss>

