<?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 do I keep decimal place precision when multiplying? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-decimal-place-precision-when-multiplying/m-p/333267#M272091</link>
    <description>&lt;P&gt;Thanks LaurieF! It worked perfectly and I only had to add a line of syntax.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Feb 2017 03:45:16 GMT</pubDate>
    <dc:creator>eap</dc:creator>
    <dc:date>2017-02-16T03:45:16Z</dc:date>
    <item>
      <title>How do I keep decimal place precision when multiplying?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-decimal-place-precision-when-multiplying/m-p/332887#M272088</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi SAS Users -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm cleaning variables (latitude and longitude) variables before pulling the dataset into ArcMap. Many of the longitude variables are (+) values and need to be converted to (-) values to map accurately in North America.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROBLEM: I'm losing precision and dropping a decimal place when I do the following. &amp;nbsp;Any Ideas?&lt;/P&gt;&lt;P&gt;Original value= +118.27436&lt;/P&gt;&lt;P&gt;New value = -118.2744&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;if long gt 0 then do;
   long2=long*-1.00000;
end;
else do;
   long2=long;
end;	
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 03:22:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-decimal-place-precision-when-multiplying/m-p/332887#M272088</guid>
      <dc:creator>eap</dc:creator>
      <dc:date>2017-02-15T03:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep decimal place precision when multiplying?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-decimal-place-precision-when-multiplying/m-p/332890#M272089</link>
      <description>&lt;P&gt;No you're not losing precision - the&amp;nbsp;&lt;EM&gt;internal&lt;/EM&gt; representation is fine. It's the external formatted value which is truncated by default.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
long = +118.27436;
if long gt 0 then do;
   long2=long*-1.00000;
end;
else do;
   long2=long;
end;
put long2= best23.;	
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 03:33:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-decimal-place-precision-when-multiplying/m-p/332890#M272089</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2017-02-15T03:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep decimal place precision when multiplying?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-decimal-place-precision-when-multiplying/m-p/332893#M272090</link>
      <description>&lt;P&gt;The difference is only in the &lt;EM&gt;displayed&lt;/EM&gt; representation. Give both variables the same format and they will display the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
long1 =  +118.27436;
format long1 long2 12.6;
long2 = -abs(long1);
put long1= / long2=;
run;

long1=118.274360
long2=-118.274360
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 04:05:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-decimal-place-precision-when-multiplying/m-p/332893#M272090</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-02-15T04:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep decimal place precision when multiplying?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-decimal-place-precision-when-multiplying/m-p/333267#M272091</link>
      <description>&lt;P&gt;Thanks LaurieF! It worked perfectly and I only had to add a line of syntax.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 03:45:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-decimal-place-precision-when-multiplying/m-p/333267#M272091</guid>
      <dc:creator>eap</dc:creator>
      <dc:date>2017-02-16T03:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I keep decimal place precision when multiplying?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-decimal-place-precision-when-multiplying/m-p/333268#M272092</link>
      <description>&lt;P&gt;Thanks PG Stats! &amp;nbsp; You're syntax worked too. I just had to tweak it to put it in the Do Loops.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I liked that your syntax resulted in Long and Long2 being side by side in the dataset instead of Long2 being at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought I would be able to accept more than one solution but that wasn't the case.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 03:59:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-keep-decimal-place-precision-when-multiplying/m-p/333268#M272092</guid>
      <dc:creator>eap</dc:creator>
      <dc:date>2017-02-16T03:59:12Z</dc:date>
    </item>
  </channel>
</rss>

