Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: string function problem


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: string function problem
Date   Wed, 20 Aug 2003 13:47:48 +0100

I think you're right in finding the help 
unclear. I suggest a wording more like 

string(n,"%fmt") converts n into a string using 
%fmt numeric display format. 

What was found with an early version of -tostring- 
was that users missed precisely this point, 
so a trap was put in to catch the error. Any 
string format is just bounced back at the user. 

-tostring- is pertinent, because it's another way 
to do it:

. tostring a1, gen(y) format(%16.0f) 

There's no gain in terms of what you type, but 
there are some advantages, like that mentioned, 
and some other safeguards. 

-tostring- was added to official Stata on 13 August. 

Nick 
n.j.cox@durham.ac.uk 

> -----Original Message-----
Ricardo Ovaldia
> 
> I though that the format had to be a string format.
> According to the help file:
> 
> "string(n,"%fmt") converts n into a string with %fmt
> display format."
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index