Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: retaining numeric formatting when using -outsheet-


From   "Beede, David N" <dbeede@doc.gov>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: retaining numeric formatting when using -outsheet-
Date   Thu, 23 Dec 2010 10:16:15 -0500

Hi - 

I know this topic has come up before, and the answer was to set the display format within Stata.  But even so, I am having problems with it.  I have done a lot of due diligence to try to find the answer but can't (I also tried using StatTransfer and -xmlsave- without success).  I want to avoid as much format-fussing in Excel as I can, but if I have to I guess I will. But if anyone has a quick fix, I would be grateful to know it.  Thanks.

Here is a snippet of code:
		recast double v*
		format v* %20.0fc		
		format *
		l v1 v2
		outsheet v1 v2 using test.csv, replace comma

Here is an excerpt from the Stata log corresponding to the snippet:
variable name  display format
  -----------------------------
  v1             %20.0fc
  v2             %20.0fc
  -----------------------------

     +----------------------+
     | v1                v2 |
     |----------------------|
  1. | 21    27,649,503,232 |
  2. |  0                 0 |
  3. | 48   213,393,129,472 |
  4. | 18   185,502,416,896 |
     +----------------------+
And here is what the Excel file looks like after using -outsheet-
v1	v2
21	27649503232
0	0
48	2.13393E+11
18	1.85502E+11

David N. Beede, Ph.D.
Economist
Office of Policy Development
Economics & Statistics Administration
U.S. Department of Commerce
Office:  Room 4872
Mailstop:  Room 4858 HCHB
1401 Constitution Avenue, N.W.
Washington, DC  20230
Telephone (202) 482-1226
dbeede@doc.gov
 
 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index