<?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 take number with one decimal in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671296#M201558</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Sorry I need exact number If I use your format it is showing 23&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;On top of what was already said, this (rounding up) is mathematically correct behavior for values where the first "discarded" digit is 5 or greater, and should usually be applied.&lt;/P&gt;
&lt;P&gt;"Exact number" is of course a very funny term when you are actively reducing precision in the first place. By applying a format with a limited number of digits, you have already thrown the concept of "exact" over board.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jul 2020 07:22:50 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-07-22T07:22:50Z</dc:date>
    <item>
      <title>how take number with one decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671069#M201474</link>
      <description>&lt;P&gt;data ex;&lt;/P&gt;
&lt;P&gt;a=23.964 ;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;create new variable and should be in numeric format only&lt;/P&gt;
&lt;P&gt;how to directly we can divide the number number with one decimal&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ex:&amp;nbsp; 23.9&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 15:19:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671069#M201474</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2020-07-21T15:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: how take number with one decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671073#M201478</link>
      <description>&lt;P&gt;Just use a numeric format with one decimal, e. g.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format a 8.1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jul 2020 15:26:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671073#M201478</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-21T15:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: how take number with one decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671079#M201482</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;b = floor (a*10)/10;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if the object is to always round down to multiples of 0.1&lt;/P&gt;
&lt;P&gt;otherwise you may need to provide more rules.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 15:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671079#M201482</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-21T15:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: how take number with one decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671085#M201484</link>
      <description>&lt;P&gt;Truncation without rounding:&lt;/P&gt;
&lt;PRE&gt;data ex;
   a = 23.964;
   b = int(a*10)/10;
run;&lt;/PRE&gt;
&lt;P&gt;See helpful article &lt;A href="https://blogs.sas.com/content/sgf/2016/12/15/truncating-decimal-numbers-in-sas-without-rounding/" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 15:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671085#M201484</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2020-07-21T15:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: how take number with one decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671090#M201486</link>
      <description>Sorry I need exact number If I use your format it is showing 23</description>
      <pubDate>Tue, 21 Jul 2020 16:07:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671090#M201486</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2020-07-21T16:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: how take number with one decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671108#M201488</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ex;
a = 23.964 ;
b = round(a, 0.1);
c = int(a*10)/10;
format b c 8.1;
run;

proc print; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs. 	a 	b 	c
1 	23.964 	24.0 	23.9&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jul 2020 16:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671108#M201488</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-07-21T16:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: how take number with one decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671121#M201493</link>
      <description>&lt;P&gt;Just remember that by converting to 23.9 using the above methods (except formatting), this number cannot be represented exactly in binary, and so that may cause issues.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 16:54:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671121#M201493</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-21T16:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: how take number with one decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671152#M201504</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Sorry I need exact number If I use your format it is showing 23&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Bullshit. See &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp;post (variable c).&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 18:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671152#M201504</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-21T18:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: how take number with one decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671167#M201508</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;I believe applying format 8.1 would actually cause &lt;STRONG&gt;a&amp;nbsp;&lt;/STRONG&gt;to show up as&amp;nbsp;24.0 (not 23.9, as in &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;'s example&amp;nbsp;c), since rounding is also applied. But it&amp;nbsp;would&amp;nbsp;definitely have a digit after the decimal point, like you indicated.&lt;/P&gt;
&lt;PRE&gt;data ex;
    a=23.964 ;
    format a 8.1;
run;
proc print; run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mklangley_0-1595355620753.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47475i9F8DDC0DB1BF11EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mklangley_0-1595355620753.png" alt="mklangley_0-1595355620753.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 18:27:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671167#M201508</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2020-07-21T18:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: how take number with one decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671296#M201558</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Sorry I need exact number If I use your format it is showing 23&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;On top of what was already said, this (rounding up) is mathematically correct behavior for values where the first "discarded" digit is 5 or greater, and should usually be applied.&lt;/P&gt;
&lt;P&gt;"Exact number" is of course a very funny term when you are actively reducing precision in the first place. By applying a format with a limited number of digits, you have already thrown the concept of "exact" over board.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 07:22:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671296#M201558</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-22T07:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: how take number with one decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671379#M201608</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
picture fmt
 low-high='0009.9';
run;

data ex;
a = 23.964 ;
format a fmt.;
run;

proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jul 2020 13:33:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-take-number-with-one-decimal/m-p/671379#M201608</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-07-22T13:33:23Z</dc:date>
    </item>
  </channel>
</rss>

