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 on April 23, and its replacement, is already up and running.

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