<?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: Maintain trailing zeroes while rounding numeric value, and convert to character in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Maintain-trailing-zeroes-while-rounding-numeric-value-and/m-p/795760#M255269</link>
    <description>&lt;P&gt;Something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;displayValue = catt(PUT(Mean, 8.2),
                                '(', 
                                  put(lb, 8.2),
                                 ", ", 
                                  put(ub, 8.2),
                                 ")"
                                );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/311553"&gt;@mariko5797&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I used PROC MEANS to obtain a mean and corresponding 95% CI. I need to output this in a table as XX.XX (XX.XX, XX.XX);&amp;nbsp;&lt;EM&gt;i.e.&lt;/EM&gt; mean (95% CI). I am having difficulties getting a consistent two decimal places. The round() and input(strip(), 5.2), but the trailing zeroes disappear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 input period trt $ mean lb ub @@;
 cards;
 1	A	33.791	32.700123	32.801568
 1	B	34.928	34.275056	35.005235
 2	A	31.320	30.567487	31.496871
 2	B	30.541	29.654630	31.507468
 ;
run;

data want;
 input period trt $ mean $ lb $ ub $ @@;
 cards;
 1	A	33.79	32.70	32.80
 1	B	34.93	34.28	35.01
 2	A	31.32	30.57	31.50
 2	B	30.54	29.65	31.51
 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Feb 2022 19:12:21 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-02-11T19:12:21Z</dc:date>
    <item>
      <title>Maintain trailing zeroes while rounding numeric value, and convert to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Maintain-trailing-zeroes-while-rounding-numeric-value-and/m-p/795756#M255266</link>
      <description>&lt;P&gt;I used PROC MEANS to obtain a mean and corresponding 95% CI. I need to output this in a table as XX.XX (XX.XX, XX.XX);&amp;nbsp;&lt;EM&gt;i.e.&lt;/EM&gt; mean (95% CI). I am having difficulties getting a consistent two decimal places. The round() and input(strip(), 5.2), but the trailing zeroes disappear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 input period trt $ mean lb ub @@;
 cards;
 1	A	33.791	32.700123	32.801568
 1	B	34.928	34.275056	35.005235
 2	A	31.320	30.567487	31.496871
 2	B	30.541	29.654630	31.507468
 ;
run;

data want;
 input period trt $ mean $ lb $ ub $ @@;
 cards;
 1	A	33.79	32.70	32.80
 1	B	34.93	34.28	35.01
 2	A	31.32	30.57	31.50
 2	B	30.54	29.65	31.51
 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Feb 2022 19:06:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Maintain-trailing-zeroes-while-rounding-numeric-value-and/m-p/795756#M255266</guid>
      <dc:creator>mariko5797</dc:creator>
      <dc:date>2022-02-11T19:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Maintain trailing zeroes while rounding numeric value, and convert to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Maintain-trailing-zeroes-while-rounding-numeric-value-and/m-p/795758#M255267</link>
      <description>&lt;P&gt;Simply apply an appropriate format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
   format mean lb ub 8.2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Feb 2022 19:08:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Maintain-trailing-zeroes-while-rounding-numeric-value-and/m-p/795758#M255267</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-02-11T19:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Maintain trailing zeroes while rounding numeric value, and convert to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Maintain-trailing-zeroes-while-rounding-numeric-value-and/m-p/795759#M255268</link>
      <description>&lt;P&gt;Show the code you use to create that stuff.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Likely you need to specify a format with PUT that uses 2 decimals such as PUT(somevariable, f6.2) which will force two decimals. The format will round the values using typical rounding rules to display the last decimal place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
 input period trt $ mean lb ub @@;
 meanchar = put (mean,5.2);
 lbchar   = put (lb,5.2);
 ubchar   = put (ub,5.2);
 cards;
 1	A	33.791	32.700123	32.801568
 1	B	34.928	34.275056	35.005235
 2	A	31.320	30.567487	31.496871
 2	B	30.541	29.654630	31.507468
 ;
run;
&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Feb 2022 19:12:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Maintain-trailing-zeroes-while-rounding-numeric-value-and/m-p/795759#M255268</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-11T19:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Maintain trailing zeroes while rounding numeric value, and convert to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Maintain-trailing-zeroes-while-rounding-numeric-value-and/m-p/795760#M255269</link>
      <description>&lt;P&gt;Something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;displayValue = catt(PUT(Mean, 8.2),
                                '(', 
                                  put(lb, 8.2),
                                 ", ", 
                                  put(ub, 8.2),
                                 ")"
                                );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/311553"&gt;@mariko5797&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I used PROC MEANS to obtain a mean and corresponding 95% CI. I need to output this in a table as XX.XX (XX.XX, XX.XX);&amp;nbsp;&lt;EM&gt;i.e.&lt;/EM&gt; mean (95% CI). I am having difficulties getting a consistent two decimal places. The round() and input(strip(), 5.2), but the trailing zeroes disappear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 input period trt $ mean lb ub @@;
 cards;
 1	A	33.791	32.700123	32.801568
 1	B	34.928	34.275056	35.005235
 2	A	31.320	30.567487	31.496871
 2	B	30.541	29.654630	31.507468
 ;
run;

data want;
 input period trt $ mean $ lb $ ub $ @@;
 cards;
 1	A	33.79	32.70	32.80
 1	B	34.93	34.28	35.01
 2	A	31.32	30.57	31.50
 2	B	30.54	29.65	31.51
 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 19:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Maintain-trailing-zeroes-while-rounding-numeric-value-and/m-p/795760#M255269</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-11T19:12:21Z</dc:date>
    </item>
  </channel>
</rss>

