decimal points

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

decimal points

nina
Dear all,

I have several numerical variables where the decimal places are separated by a comma (e.g. 5,44).

Which syntax command would you recommend to convert the commas into decimal points (so that the value would read 5.44)?

Many thanks,
Nina

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: decimal points

Rick Oliver-3
When reading the data with GET DATA or DATA LIST, use the DOT format.

If the data have already been read and these variables were read as strings:

compute numvar=number(stringvar, DOT8.2).

If it's already a numeric variable, but is being displayed with a comma as the decimal indicator, just change the display format:

formats numvar (F8.2).

Rick Oliver
Senior Information Developer
IBM Business Analytics (SPSS)
E-mail: [hidden email]




From:        Nina Lasek <[hidden email]>
To:        [hidden email]
Date:        01/15/2015 01:31 PM
Subject:        decimal points
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Dear all,

I have several numerical variables where the decimal places are separated by a comma (e.g. 5,44).

Which syntax command would you recommend to convert the commas into decimal points (so that the value would read 5.44)?

Many thanks,
Nina

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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 [hidden email] (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