1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
*(Q) How can I convert numbers into strings.

*(A) By Raynald.
* http://pages.infinit.net/rlevesqu/index.htm.

DATA LIST LIST /nb.
BEGIN DATA
125.25
1.2255
12222
END DATA.

STRING str1 TO str4(A10).
COMPUTE str1=STRING(nb,F8).
COMPUTE str2=STRING(nb,F8.2).
COMPUTE str3=STRING(nb,N8).
COMPUTE str4=STRING(nb,DOLLAR8.2).
LIST.