<?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: Rounding to 2 decimals and combining numbers such  27.00(18.70) without dropping trailing zeros in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Rounding-to-2-decimals-and-combining-numbers-such-27-00-18-70/m-p/889382#M351382</link>
    <description>&lt;P&gt;Anytime SAS converts a numeric value to character, such as to concatenate the values you attempt, it uses a BEST. format which doesn't show trailing zeroes. So you use a PUT and provide a desired format so you control the conversion.&lt;/P&gt;
&lt;P&gt;You may find the -L option with the PUT function as in Put(meadrd,8.2 -L) useful to create values without any leading spaces that require another function to remove.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2023 16:23:46 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-08-15T16:23:46Z</dc:date>
    <item>
      <title>Rounding to 2 decimals and combining numbers such  27.00(18.70) without dropping trailing zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-to-2-decimals-and-combining-numbers-such-27-00-18-70/m-p/889372#M351378</link>
      <description>&lt;P&gt;I'm trying to create a single field with the mean and standard deviation combined in mean(std) format. I have it mostly figured out, but the problem is that trailing zeros are being truncated. So rather than 27.00(18.70), it shows up as 27(18.7).&amp;nbsp; But numbers such as 14.21(15.04) show up properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the code below, the zeros are already truncated in the "test" dataset. How do I add them back in? The final numbers will be exported to an Excel table, so I don't think I could just apply a format to them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
    input Mean Std;
    datalines;
	14.2123	15.0416
	27.0000	18.7000
	27.3185	19.8000
;

data want; set test;

StdRD = ROUND(Std,.01);
MeanRD = ROUND(Mean,.01);

Final_output = COMPRESS(MeanRD||"("||StdRD||")");

RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 15:24:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-to-2-decimals-and-combining-numbers-such-27-00-18-70/m-p/889372#M351378</guid>
      <dc:creator>Wolverine</dc:creator>
      <dc:date>2023-08-15T15:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding to 2 decimals and combining numbers such  27.00(18.70) without dropping trailing zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-to-2-decimals-and-combining-numbers-such-27-00-18-70/m-p/889373#M351379</link>
      <description>&lt;P&gt;Use the PUT function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Final_output = COMPRESS(put(MeanRD,8.2)||"("||put(StdRD,8.2)||")");
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Aug 2023 15:36:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-to-2-decimals-and-combining-numbers-such-27-00-18-70/m-p/889373#M351379</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-15T15:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding to 2 decimals and combining numbers such  27.00(18.70) without dropping trailing zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-to-2-decimals-and-combining-numbers-such-27-00-18-70/m-p/889374#M351380</link>
      <description>It seems so simple now!  Thanks!</description>
      <pubDate>Tue, 15 Aug 2023 15:39:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-to-2-decimals-and-combining-numbers-such-27-00-18-70/m-p/889374#M351380</guid>
      <dc:creator>Wolverine</dc:creator>
      <dc:date>2023-08-15T15:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding to 2 decimals and combining numbers such  27.00(18.70) without dropping trailing zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-to-2-decimals-and-combining-numbers-such-27-00-18-70/m-p/889382#M351382</link>
      <description>&lt;P&gt;Anytime SAS converts a numeric value to character, such as to concatenate the values you attempt, it uses a BEST. format which doesn't show trailing zeroes. So you use a PUT and provide a desired format so you control the conversion.&lt;/P&gt;
&lt;P&gt;You may find the -L option with the PUT function as in Put(meadrd,8.2 -L) useful to create values without any leading spaces that require another function to remove.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 16:23:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-to-2-decimals-and-combining-numbers-such-27-00-18-70/m-p/889382#M351382</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-08-15T16:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding to 2 decimals and combining numbers such  27.00(18.70) without dropping trailing zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-to-2-decimals-and-combining-numbers-such-27-00-18-70/m-p/889387#M351385</link>
      <description>&lt;P&gt;Alternative solution using the VVALUE function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set test;
    stdrd = round(std,.01);
    meanrd = round(mean,.01);
    format stdrd meanrd 8.2;
    final_output = compress(vvalue(meanrd)||"("||vvalue(stdrd)||")");
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Aug 2023 16:38:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-to-2-decimals-and-combining-numbers-such-27-00-18-70/m-p/889387#M351385</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-15T16:38:53Z</dc:date>
    </item>
  </channel>
</rss>

