<?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: Determine Decimal DIGIT of Variable? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Determine-Decimal-DIGIT-of-Variable/m-p/331186#M74396</link>
    <description>&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you give more information about &amp;nbsp;1e6, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Feb 2017 15:19:28 GMT</pubDate>
    <dc:creator>ertr</dc:creator>
    <dc:date>2017-02-09T15:19:28Z</dc:date>
    <item>
      <title>Determine Decimal DIGIT of Variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-Decimal-DIGIT-of-Variable/m-p/331177#M74391</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to determine decimal digit&amp;nbsp;of &amp;nbsp;my variables which has&amp;nbsp;fractional number. I have a sample data set as below and my desired output also as below. &amp;nbsp;I don't want to round variiables's values, I just want to cut the decimal part when it comes 6th digit on decimal part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Sample;
Input Fractional;
Datalines;
1.12345678
2.87654321
3.56781234
4.24135768
5
;
Run;
Data Want;
Set Sample;
Decimal=Round(Fractional,.000001);
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;DESIRED&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7147i0916DBB1CEDF8DFF/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Desired.png" title="Desired.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 14:59:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-Decimal-DIGIT-of-Variable/m-p/331177#M74391</guid>
      <dc:creator>ertr</dc:creator>
      <dc:date>2017-02-09T14:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Decimal DIGIT of Variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-Decimal-DIGIT-of-Variable/m-p/331183#M74393</link>
      <description>&lt;P&gt;Not elegant, but simple and working:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Decimal=floor(Fractional*1000000)/1000000;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 15:11:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-Decimal-DIGIT-of-Variable/m-p/331183#M74393</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2017-02-09T15:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Decimal DIGIT of Variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-Decimal-DIGIT-of-Variable/m-p/331184#M74394</link>
      <description>Decimal6=Int(fractional*1e6)/1e6;</description>
      <pubDate>Thu, 09 Feb 2017 15:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-Decimal-DIGIT-of-Variable/m-p/331184#M74394</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2017-02-09T15:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Decimal DIGIT of Variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-Decimal-DIGIT-of-Variable/m-p/331186#M74396</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you give more information about &amp;nbsp;1e6, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 15:19:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-Decimal-DIGIT-of-Variable/m-p/331186#M74396</guid>
      <dc:creator>ertr</dc:creator>
      <dc:date>2017-02-09T15:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Decimal DIGIT of Variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-Decimal-DIGIT-of-Variable/m-p/331189#M74398</link>
      <description>&lt;P&gt;Maybe the easiest is just to pick an appropriate fixed decimal format;&lt;/P&gt;
&lt;PRE&gt;Data Sample;
Input Fractional;
put (Fractional Fractional Fractional) (f10.2 f10.4 f10.6);
Datalines;
1.12345678
2.87654321
3.56781234
4.24135768
5
;
Run;&lt;/PRE&gt;
&lt;P&gt;If you already have the data set and values then just use the desired format for print/report/ other procedure. Then the&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 15:25:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-Decimal-DIGIT-of-Variable/m-p/331189#M74398</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-02-09T15:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Decimal DIGIT of Variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-Decimal-DIGIT-of-Variable/m-p/331191#M74399</link>
      <description>It's scientific notation, 1e6=1000000&lt;BR /&gt;&lt;BR /&gt;In scientific notation, the number before the E is multiplied by the power of ten that is indicated by the number after the E. For example, 2E4 is the same as 2x104 or 20,000. For numeric constants larger than (1032 )-1, you must use scientific notation. Additional examples follow:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780334.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780334.htm&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Feb 2017 15:27:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-Decimal-DIGIT-of-Variable/m-p/331191#M74399</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2017-02-09T15:27:24Z</dc:date>
    </item>
  </channel>
</rss>

