<?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 function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590792#M169142</link>
    <description>&lt;P&gt;INT() grabs the integer portion ignoring the decimal component entirely.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ROUND() rounds to the &lt;STRONG&gt;nearest interval&lt;/STRONG&gt; - where you can specify what interval you want, with the default being 1.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nearest interval varies because you can round to the nearest 1, 5, 10 or 15 in SAS which is often quite convenient.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case, your number is 345.653 which is closer to 346 rather than 345 &lt;STRONG&gt;so 346 is the correct value when rounding to the nearest integer.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to decide which one you want to use, but both work appropriately.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253321"&gt;@CathyVI&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am asked to round 345.653 to the &lt;STRONG&gt;nearest integer values&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used x=round(345.653, 1)&amp;nbsp; and i got 346.000 is this the correct answer ? I was expecting 345 as my answer. How can i get 345 ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Sep 2019 01:51:16 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-09-23T01:51:16Z</dc:date>
    <item>
      <title>round function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590752#M169125</link>
      <description>&lt;P&gt;I am asked to round 345.653 to the &lt;STRONG&gt;nearest integer values&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used x=round(345.653, 1)&amp;nbsp; and i got 346.000 is this the correct answer ? I was expecting 345 as my answer. How can i get 345 ?&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2019 18:25:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590752#M169125</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2019-09-22T18:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: round function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590753#M169126</link>
      <description>&lt;P&gt;What you wrote sounds like you'd rather prefer INT than a ROUND up/down. Can you confirm?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If yes, use&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x=int(345.653)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Sep 2019 18:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590753#M169126</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-22T18:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: round function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590754#M169127</link>
      <description>my goal is to change 345.653 to 346</description>
      <pubDate>Sun, 22 Sep 2019 18:44:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590754#M169127</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2019-09-22T18:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: round function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590756#M169128</link>
      <description>&lt;P&gt;In that case, all you need is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x=round(345.653)  ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Sep 2019 18:49:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590756#M169128</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-22T18:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: round function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590757#M169129</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253321"&gt;@CathyVI&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am asked to round 345.653 to the &lt;STRONG&gt;nearest integer values&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used x=round(345.653, 1)&amp;nbsp; and i got 346.000 is this the correct answer ? I was expecting 345 as my answer. How can i get 345 ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It is the correct value for the typically used "round half up" method. Anything from 345.5 and up is rounded up to 346.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2019 18:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590757#M169129</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-22T18:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: round function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590758#M169130</link>
      <description>the x=int(345.653) worked. I was able to get 346 but i have to create another variable&lt;BR /&gt;for example v1= int(345.653) = 346 but when i did&lt;BR /&gt;v1= int(v1), i got the 345.000.&lt;BR /&gt;Thank you</description>
      <pubDate>Sun, 22 Sep 2019 18:54:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590758#M169130</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2019-09-22T18:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: round function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590759#M169131</link>
      <description>&lt;P&gt;INT doesn't work here. You need to use ROUND().&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2019 18:59:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590759#M169131</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-22T18:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: round function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590792#M169142</link>
      <description>&lt;P&gt;INT() grabs the integer portion ignoring the decimal component entirely.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ROUND() rounds to the &lt;STRONG&gt;nearest interval&lt;/STRONG&gt; - where you can specify what interval you want, with the default being 1.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nearest interval varies because you can round to the nearest 1, 5, 10 or 15 in SAS which is often quite convenient.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case, your number is 345.653 which is closer to 346 rather than 345 &lt;STRONG&gt;so 346 is the correct value when rounding to the nearest integer.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to decide which one you want to use, but both work appropriately.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253321"&gt;@CathyVI&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am asked to round 345.653 to the &lt;STRONG&gt;nearest integer values&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used x=round(345.653, 1)&amp;nbsp; and i got 346.000 is this the correct answer ? I was expecting 345 as my answer. How can i get 345 ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 01:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/round-function/m-p/590792#M169142</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-23T01:51:16Z</dc:date>
    </item>
  </channel>
</rss>

