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 (March 2009, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 31 Mar 2009 09:27:38 -0700
Reply-To:   brian_c_wallace@yahoo.com
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Brian Wallace <brian_c_wallace@YAHOO.COM>
Subject:   Is there a way to remove trailing zeros from a numeric variable?
Content-Type:   text/plain; charset=us-ascii

I keep running up against the defined format. I've tried converting the numeric variable back to a character using the BEST format then BACK to a numeric but I keep losing precision.

An example. I've converted these character variables to numeric variables:

character variables --> converted to --> numeric variables

49.9568 sq. cm 49.9568000 50.3701 sq. cm 50.3701000 6.43636 sq. cm 6.4363600 4.48661 sq. cm 4.4866100 0.0297726 sq. cm 0.0297726

Now, I need to remove those trailing zeros, yet keep the variable a numeric variable and not loose any precision. I need them to look like:

49.9568 50.3701 6.43636 4.48661 0.0297726

but still remain numbers.

Any suggestions would be greatly appreciated.

Thank you,

Brian Wallace


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