<?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 to force an integer to show decimal points in rounding in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-force-an-integer-to-show-decimal-points-in-rounding/m-p/835933#M330513</link>
    <description>thank you so much! that worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Thu, 29 Sep 2022 19:41:49 GMT</pubDate>
    <dc:creator>nessak</dc:creator>
    <dc:date>2022-09-29T19:41:49Z</dc:date>
    <item>
      <title>How to force an integer to show decimal points in rounding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-force-an-integer-to-show-decimal-points-in-rounding/m-p/835928#M330509</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First time posting, so apologies if I'm not doing this correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create reports where all the numbers are rounded to two decimal points. The code I have works, except for when the observation is a whole number. For example, 2.4378 will round to 2.44 like I want it to, but a flat 5 just shows up as 5. I would like it to show as 5.00 but am having trouble figuring out how to do so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is one example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data raw_deltas;
	set &amp;amp;dat._p_;

	%do i=1 %to &amp;amp;t;
		t&amp;amp;i = round(t&amp;amp;i, 0.01);
	%end;

	%do i=2 %to &amp;amp;t;
		delta&amp;amp;i = round(delta&amp;amp;i, 0.01);
		delta_&amp;amp;i = round(delta_&amp;amp;i, 0.01);
	%end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 19:26:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-force-an-integer-to-show-decimal-points-in-rounding/m-p/835928#M330509</guid>
      <dc:creator>nessak</dc:creator>
      <dc:date>2022-09-29T19:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to force an integer to show decimal points in rounding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-force-an-integer-to-show-decimal-points-in-rounding/m-p/835930#M330511</link>
      <description>&lt;P&gt;Assign a format to the variable like F9.2&amp;nbsp; That will display the value as 9 characters including 2 decimals. Use a number larger than 9 if you need more positions. Generally any thing related to display of a single value can be resolved with a proper format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;data raw_deltas;
	set &amp;amp;dat._p_;

	%do i=1 %to &amp;amp;t;
		t&amp;amp;i = round(t&amp;amp;i, 0.01);
	%end;

	%do i=2 %to &amp;amp;t;
		delta&amp;amp;i = round(delta&amp;amp;i, 0.01);
		delta_&amp;amp;i = round(delta_&amp;amp;i, 0.01);
	%end;&lt;BR /&gt;   format t1-t&amp;amp;t.  delta2-delta&amp;amp;t. delta_2-delta_&amp;amp;t. F9.2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 19:34:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-force-an-integer-to-show-decimal-points-in-rounding/m-p/835930#M330511</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-09-29T19:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to force an integer to show decimal points in rounding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-force-an-integer-to-show-decimal-points-in-rounding/m-p/835933#M330513</link>
      <description>thank you so much! that worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 29 Sep 2022 19:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-force-an-integer-to-show-decimal-points-in-rounding/m-p/835933#M330513</guid>
      <dc:creator>nessak</dc:creator>
      <dc:date>2022-09-29T19:41:49Z</dc:date>
    </item>
  </channel>
</rss>

