Bookmark and Share

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]

Re: st: Decimal Precision with Destring


From   Maarten buis <[email protected]>
To   [email protected]
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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index