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

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


I tested your value:
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 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.

Dan Blanchette

Research Programming Services
Carolina Population Center
University of North Carolina

On Wed, Aug 1, 2012 at 3:33 PM,  <> 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 :

Hope this helps,

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index