Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Maarten buis <maartenbuis@yahoo.co.uk> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Decimal Precision with Destring |
Date | Mon, 19 Apr 2010 07:44:21 -0700 (PDT) |
--- On Mon, 19/4/10, Sutton, Bennett W. wrote: > I am insheet-ing a .csv file with decimal precision set at > 15 places in excel. But after insheeting into stata, > the series are data type double, but only have precision to > 10 places. I'm working with hyperinflation countries > and the lack of precision is producing some incorrect > results in calculations. In the example below, -insheet- results in a precision of 15 digits that you require. Maybe something went wrong in the conversion from Excel to .csv? *--------- begin example ----------- clear input double x 123456789012345 end format x %20.15g di %20.15g x tempfile a outsheet using `a' clear insheet using `a' di %20.15g x *----------- end example ----------- Hope this helps, Maarten -------------------------- Maarten L. Buis Institut fuer Soziologie Universitaet Tuebingen Wilhelmstrasse 36 72074 Tuebingen Germany http://www.maartenbuis.nl -------------------------- * * 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/