Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: AW: AW: tostring command
From
"Martin Weiss" <[email protected]>
To
<[email protected]>
Subject
st: AW: AW: tostring command
Date
Fri, 23 Apr 2010 11:58:23 +0200
<>
Sometimes, it also helps to conduct low-level experiments with the
-string()- function <
http://www.stata.com/statalist/archive/2009-01/msg00194.html> to get a
handle on these problems. It works with -display- which allows "faster
turnover of ideas":
*************
di in r string(12345612345 , "%11.0f")
*************
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Martin Weiss
Gesendet: Freitag, 23. April 2010 11:50
An: [email protected]
Betreff: st: AW: tostring command
<>
Either -force- it or supply your own -format-, with the latter option
strongly perferred:
*************
clear*
set obs 1
gen double myvar=12345612345
format myvar %11.0f
l
tostring myvar, generate(mystrvar) force
tostring myvar, generate(mystrvar2) format(%11.0f)
l
*************
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Rajaram
Subramanian Potty
Gesendet: Freitag, 23. April 2010 11:31
An: [email protected]
Betreff: st: tostring command
Dear all,
When I am using the command "tostring" to convert numerical variable
to string variable I am getting an error.
The error is "indid cannot be converted reversibly; no generate".
This error comes only if the numerical varibale has 11 or more
digits. Because of this not able to convert numerical variables with
11 or more digits to string variable. Can any one know the solution to
convert the numerical variable to string variable even if the variable
has 11 or more digits.
Thanks and regards,
RAJARAM. S
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/