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: Stop Stata rounding up decimal places when import from Excel


From   Dan Blanchette <[email protected]>
To   [email protected]
Subject   Re: st: Stop Stata rounding up decimal places when import from Excel
Date   Thu, 2 Aug 2012 09:28:00 -0400 (EDT)

Sorada,

I tested your value:
 1234567.1234567
and -import excel- by default read in that column as a double
but set the format for that variable to be too small to show all the values...so it looked like Stata rounded it but it
really did not.  Try setting the format to be %15.0g so you
can see the full value.

HTH,
Dan Blanchette

Research Programming Services
Carolina Population Center
University of North Carolina
[email protected]



On Wed, Aug 1, 2012 at 3:33 PM,  <[email protected]> wrote:
In my excel file I have one variable that has 7 digits and 7 decimal places, e.g. 1234567.1234567.

When I import the file into Stata, it rounds up the decimal place of the variable to 1234567.12

How can I change the setting so that Stata would not round up my decimal places?

You need to make sure to import that variable as a double not as a float.

For (much) more see :
<http://blog.stata.com/2012/04/02/the-penultimate-guide-to-precision/>

Hope this helps,
Maarten

*
*   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