Date: Tue, 1 Jan 2008 11:12:49 -0500
Reply-To: Art@DrKendall.org
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Art Kendall <Arthur.Kendall@verizon.net>
Subject: Re: rounding and truncating??
In-Reply-To: <BE3FA3B86F9D4643B1162B55FBB4FEA4057D36@exchange.nso.gov.er>
Content-type: text/plain; charset=ISO-8859-1; format=flowed
if you just want to change how the number is displayed try something like
formats myvar (f4).
if you want to show no places or
formats myvar(f6.3).
to show 3 places etc.
if you want to have a variable with an actual change to the contents try
something like
compute newvar0 = rnd(oldvar).
to round to an integer.
or
compute newvar2 = rnd(100*oldvar)/100.
to have 2 places after the decimal.
Art Kendall
Social Research Consultants
Samuel Solomon wrote:
> dear all,
> how can i round decimals in to 2 or 3 or 4 ....or rth decimal places.
> thanks
> samuel.
>
> ===================
> To manage your subscription to SPSSX-L, send a message to
> LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>
>
>
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
|