Results 1 to 2 of 2
  1. #1
    Degs29 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2013
    Posts
    38

    Too many digits!

    I have a basic multiplication expression as part of a query in the form of A*B where A is always an integer and B is a real number with anywhere between 0 and 6 decimal places. When running the query I get returned far more decimal places than are necessary. For an actual example:



    10*0.07249 = 0.724899999000246

    Obviously, once rounded this is the correct number (0.7249), but why is it doing this in the first place?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Access/computers don't store the precise real number. They approximate it to various numbers of digits/bits. If you don't like the default number of decimal places, you can ask to have fewer.
    see http://www.techonthenet.com/access/f...eric/round.php

    Here's an analogy:

    Suppose you asked someone "How far is it from the US Capitol Building to the Washington monument".

    And they said
    Using Google maps I find it to be
    Miles 1.38390935013792
    Kilometers 2.22718620918837 and

    using a great circle calculation I get
    Miles GreatCircle 1.38397013082645
    Kilometers GreatCircle 2.22728402622381, and then

    you say yea I sort of thought it was a little less than a mile and a half.

    So if you don't specify how many digits (details) you want, you get the default.
    And correct is in the eye of the person posing the question "What level of detail do you want/need/expect?"

    Code:
    startName = "Washington Monument" 
    endName = "Capitol Building, Washington,DC"
    startLat = 38.8894515
     startLong = -77.0348573 
    endLat = 38.8899352 
    endLong = -77.0091304
    Last edited by orange; 05-30-2013 at 12:55 PM. Reason: format

Please reply to this thread with any new information or opinions.

Similar Threads

  1. checkers digits
    By fabiobarreto10 in forum Programming
    Replies: 2
    Last Post: 11-13-2012, 03:15 PM
  2. Allow only 4 digits in field
    By funkygoorilla in forum Forms
    Replies: 2
    Last Post: 12-01-2011, 09:21 AM
  3. New Computer not accepting 5 digits
    By abie059 in forum Database Design
    Replies: 3
    Last Post: 01-10-2011, 10:02 PM
  4. rounding digits
    By giladweil in forum Access
    Replies: 1
    Last Post: 09-01-2010, 03:11 AM
  5. Report query by digits
    By The Phil in forum Reports
    Replies: 4
    Last Post: 04-23-2010, 11:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums