<?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: round down by 1000 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/round-down-by-1000/m-p/874643#M345591</link>
    <description>&lt;P&gt;As Paige says, the FLOOR function will round all numbers toward negative infinity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For negative values, some people prefer to round toward zero. If you want to round toward zero, use the INT function:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;x_new=int(x/1000)*1000;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;For more information about rounding, see&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2011/10/03/rounding-up-rounding-down.html" target="_self"&gt;"Rounding up, rounding down"&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 May 2023 11:06:23 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2023-05-09T11:06:23Z</dc:date>
    <item>
      <title>round down by 1000</title>
      <link>https://communities.sas.com/t5/SAS-Programming/round-down-by-1000/m-p/874636#M345589</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to create a new column called X_New .&lt;/P&gt;
&lt;P&gt;The value in X_New column will be the rounded down value of column X.&lt;/P&gt;
&lt;P&gt;The expected values are:&lt;/P&gt;
&lt;P&gt;X=4000 ,X_New=4000&lt;/P&gt;
&lt;P&gt;X=4200,X_New=4000&lt;/P&gt;
&lt;P&gt;X=4500, X_New=4000&lt;/P&gt;
&lt;P&gt;X=4600, X_New=4000&lt;/P&gt;
&lt;P&gt;X=4900, X_New=4000&lt;/P&gt;
&lt;P&gt;X=5000, X_New=5000&lt;/P&gt;
&lt;P&gt;X=5100, X_New=5000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the way to round down by 1000 ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x;
cards;
4000
4200
4500
4600
4900
5000
5100
0
.
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 10:47:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/round-down-by-1000/m-p/874636#M345589</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2023-05-09T10:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: round down by 1000</title>
      <link>https://communities.sas.com/t5/SAS-Programming/round-down-by-1000/m-p/874637#M345590</link>
      <description>&lt;P&gt;Use the FLOOR function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x_new=floor(x/1000)*1000;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 May 2023 10:49:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/round-down-by-1000/m-p/874637#M345590</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-09T10:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: round down by 1000</title>
      <link>https://communities.sas.com/t5/SAS-Programming/round-down-by-1000/m-p/874643#M345591</link>
      <description>&lt;P&gt;As Paige says, the FLOOR function will round all numbers toward negative infinity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For negative values, some people prefer to round toward zero. If you want to round toward zero, use the INT function:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;x_new=int(x/1000)*1000;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;For more information about rounding, see&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2011/10/03/rounding-up-rounding-down.html" target="_self"&gt;"Rounding up, rounding down"&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 11:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/round-down-by-1000/m-p/874643#M345591</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-05-09T11:06:23Z</dc:date>
    </item>
  </channel>
</rss>

