Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: new string variable which has the formatted value of a variable


From   Jeph Herrin <[email protected]>
To   [email protected]
Subject   Re: st: new string variable which has the formatted value of a variable
Date   Wed, 07 Jan 2009 10:36:24 -0500

I think -tostring- will work with the -format()- option.
Or, if you want to call mata you can use -sprintf()-.

hope this helps,
Jeph


Ashim Kapoor wrote:
This is great. Will do part of what I what . I still need the magic
command to do magic on dates.

Thank you ,
Ashim

On Wed, Jan 7, 2009 at 5:21 PM, Neil Shephard <[email protected]> wrote:
Not sure about dates, but for your second example you can do the following....

gen str magicj = string(round(j, .01))

Neil
--
"We should make things as simple as possible, but not simpler."  -
Anon (not Albert Einstein)

Email - [email protected]
Website - http://slack.ser.man.ac.uk/
Photos - http://www.flickr.com/photos/slackline/
*
*   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/



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