LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2011, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 17 Feb 2011 09:05:17 -0500
Reply-To:     Lorne Klassen <lk1@ROGERS.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Lorne Klassen <lk1@ROGERS.COM>
Subject:      Re: Counting digits
Comments: To: Barry Schwarz <barry.a.schwarz@BOEING.COM>

Barry, I should've mentioned that our values will never go beyond large dollar amounts. I can't see any way we would have more than 12 digits to the left of the decimal. I just used the format 32. for good measure.

On Thu, 17 Feb 2011 03:58:34 -0800, Schwarz, Barry A <barry.a.schwarz@BOEING.COM> wrote:

>What value would like to obtain for the SAS constant 1.35e147? > >-----Original Message----- >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Lorne Klassen >Sent: Wednesday, February 16, 2011 3:47 PM >To: SAS-L@LISTSERV.UGA.EDU >Subject: Counting digits > >Simple question: I want to get the number of digits to the left of the >decimal place from a value in a numeric variable (excluding negative sign >if there is one). > >I can live with the following which works but I'm wondering if it can be >even simpler than this? I thought there might be a numeric function to do >it directly but couldn't find one. > >y = 76877.234; >result = countc(put(int(y),32.),,"d"); > or >result = length(compress(put(int(y),32.)," -"));


Back to: Top of message | Previous page | Main SAS-L page