<?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 numbers in pct format in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Round-down-numbers-in-pct-format/m-p/218278#M53684</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Multiply by 10 to round to number such as 7.8, 7.2, 9.9. Apply the floor function and then convert back to percent by dividing by 10. &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Simplifying the math it becomes:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Pct_in_school=floor(days_in_school/18)/10;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Pct_in_course=floor(days_in_course/18)/10;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;format Pct_in_school Pct_in_course percent12.;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Apr 2015 18:49:11 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-04-09T18:49:11Z</dc:date>
    <item>
      <title>Round down numbers in pct format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Round-down-numbers-in-pct-format/m-p/218277#M53683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is the data step I have which formats each number as a percent.&amp;nbsp; I want to round pct_in_school and pct_in_course&amp;nbsp; down to the nearest ten like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;78% would be 70%&lt;/P&gt;&lt;P&gt;72% would be 70%&lt;/P&gt;&lt;P&gt;99% would be 90%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data rosters;&lt;/P&gt;&lt;P&gt;set allsets2;&lt;/P&gt;&lt;P&gt;diff = intck('WEEKDAY', entrydate, exitdate);&lt;/P&gt;&lt;P&gt;days_in_school = networkdays(entrydate, exitdate-1, "work.usholidays","holidaydate");&lt;/P&gt;&lt;P&gt;days_in_course = networkdays(dateenrolled, dateleft-1, "work.usholidays","holidaydate");&lt;/P&gt;&lt;P&gt;Pct_in_school=days_in_school/180;&lt;/P&gt;&lt;P&gt;Pct_in_course=days_in_course/180;&lt;/P&gt;&lt;P&gt;format Pct_in_school Pct_in_course percent12.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 18:29:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Round-down-numbers-in-pct-format/m-p/218277#M53683</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2015-04-09T18:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Round down numbers in pct format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Round-down-numbers-in-pct-format/m-p/218278#M53684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Multiply by 10 to round to number such as 7.8, 7.2, 9.9. Apply the floor function and then convert back to percent by dividing by 10. &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Simplifying the math it becomes:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Pct_in_school=floor(days_in_school/18)/10;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Pct_in_course=floor(days_in_course/18)/10;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;format Pct_in_school Pct_in_course percent12.;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 18:49:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Round-down-numbers-in-pct-format/m-p/218278#M53684</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-09T18:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Round down numbers in pct format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Round-down-numbers-in-pct-format/m-p/218279#M53685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And just in case you might like to keep the original value but display use a custom format:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format ;&lt;/P&gt;&lt;P&gt;value MyPct&lt;/P&gt;&lt;P&gt;0&amp;nbsp;&amp;nbsp; -&amp;lt; 0.1 = '&amp;nbsp; 0%';&lt;/P&gt;&lt;P&gt;0.1 -&amp;lt; 0.2 = ' 10%'&lt;/P&gt;&lt;P&gt;0.2 -&amp;lt; 0.3 = ' 20%'&lt;/P&gt;&lt;P&gt;&amp;lt;repeat pattern&amp;gt;&lt;/P&gt;&lt;P&gt;0.9 -&amp;lt; 1&amp;nbsp; = ' 90%'&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp; '100%'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The spaces are so some procedures can display formatted values in an appropriate sorted appearance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 20:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Round-down-numbers-in-pct-format/m-p/218279#M53685</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-04-09T20:00:24Z</dc:date>
    </item>
  </channel>
</rss>

