+ Reply to Thread
Results 1 to 2 of 2

Excel changing numberto add decimal places

  1. #1
    Registered User
    Join Date
    01-30-2013
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Excel changing numberto add decimal places

    I am using Excel 2007 and importing a list of coordinates. The coordinates are in a text file and separated by commas, so I'm opening the file as a delimitted file. All of the coordinates import correctly except one. The value is supposed to 52530.6372, but Excel is automatically changing it to 52530.6371999999


    If I manually type a "2" to replace the "1999999", it changes it back. If I type "3" it stays as a 3.


    I added a round function to force it to round to 4 decimal places and that seemed to work until I then tried using the number with text commands. When I used an ampersand to insert the number into a text string, the additional decimal places are back, even with a round function!


    Any thoughts?


    Thanks,

    Joe

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Excel changing numberto add decimal places

    From http://www.cpearson.com/excel/rounding.htm
    not every fractional value can be stored exactly accurately. For example, it is impossible to store the number 1/10 = 0.1 in binary form.
    You are up against one of those many fractions that does not have an exact, finite representation in binary (just like 2/3 does not have an exact, finite representation in decimal). Any time you have the computer perform an operation on that number, it reverts to its binary approximation, and you get the long list of 9's added.

    You might consider using the =TEXT() function http://office.microsoft.com/en-us/ex...840.aspx?CTT=1 where you can specify that the text conversion is only to 4 digits past the decimal [=TEXT(A1,"0.0000")]
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1