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: RE: formatting of a %td variable in over() in graphs
From
"Airey, David C" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: RE: formatting of a %td variable in over() in graphs
Date
Fri, 9 Jul 2010 16:44:53 -0500
.
Thank you very much!
I never used the string(n,s) function. That's useful. Now I know.
String function
string(n)
Domain: -8e+307 to 8e+307 and missing
Range: strings
Description: returns n converted to a string:
string(4)+"F" = "4F"
string(1234567) = "1234567"
string(12345678) = "1.23e+07"
string(.) = "."
string(n,s)
Domain n: -8e+307 to 8e+307 and missing
Domain s: strings containing %fmt numeric display format
Range: strings
Description: returns n converted to a string:
string(4,"%9.2f") = "4.00"
string(123456789,"%11.0g") = "123456789"
string(123456789,"%13.0gc" = "123,456,789"
string(0,"%td") = "01jan1960"
string(225,"%tq") = "2016q2"
string(225,"not a format") = ""
> You can always put the thing through the -string()- function beforehand,
> though:
>
> *************
> sysuse auto, clear
> keep in 1/10
> gen day=18320+_n
> form day %td
> gen day2=string(day, "%td")
> graph bar (mean) price, over(day2, label(angle(forty_five)))
> *************
>
>
> HTH
> Martin
>
>
*
* 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/