Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: Decimal Precision with Destring

From   Maarten buis <>
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 -----------
input double x
format x %20.15g
di %20.15g x

tempfile a
outsheet using `a'

insheet using `a'

di %20.15g x
*----------- end example -----------

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen


*   For searches and help try:

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