Results 1 to 4 of 4
  1. #1
    LJB is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2021
    Posts
    1

    Unhappy Calculated field should not be rounded off the third(3) number after the decimal (thousandths)....


    Calculated field should not be rounded off the third(3) number after the decimal (thousandths)....Click image for larger version. 

Name:	problem A.jpg 
Views:	14 
Size:	108.4 KB 
ID:	45994

  2. #2
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Fixed format results in at least one number to the left and only 2 to the right of the decimal, IIRC. So you've forced Access to round if the value is really 544.285 to 544.289
    FWIW, calculated table fields are not recommended. I venture to say that it would be rare for seasoned developer to use them in anything other than a db meant for testing/playing around.

    http://allenbrowne.com/casu-14.html
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    I suggest using Decimal and specify scale and precision properties in the table.
    Precision is the total number of digits allowed in a number, including left and right of the decimal.
    Scale is the number of digits allowed to the right of the decimal.


    So 1234567.89 has a precision of 9.
    123456.789 has a precision of 9 and a scale of 3.


    A precision of 4 and scale of 2 would result in a number with a maximum value of 99.99


    Percent designations like 125.5% would require precision 4 and scale of 3 (not one) since it is actually stored as 1.255.


    Precision has a maximum value of 28, but textboxes in forms allow only a max of about 15 decimal places.


    Increasing the scale from 0 to perhaps 4 would give the forcing of 2 decimal places more rounding room to work with.

  4. #4
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    In the image in Post #1, setting the number of decimals, you are just setting the FORMAT displayed, NOT the actual value stored in the field.
    Multiplication and division change the number of decimals in the result, so it matters when you do the rounding.
    You have to actually change the calculated values stored in the fields. AND,.

    Don't know how clear the following will be:
    Click image for larger version. 

Name:	DecimalCalc1.png 
Views:	8 
Size:	57.9 KB 
ID:	46004

    As you can see, if you use the Round function, the number add up to what you expect it to be.

    And as Micron pointed out, using calculated fields is a bad idea. Calculations should be done in a query, in a text box control on a form/report or even in code - but NEVER in a table.

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

Similar Threads

  1. Calculated field decimal places
    By Poohbear0471 in forum Forms
    Replies: 2
    Last Post: 01-04-2020, 10:43 PM
  2. Replies: 7
    Last Post: 11-27-2017, 08:47 PM
  3. Insert decimal into number field
    By JackieEVSC in forum Queries
    Replies: 3
    Last Post: 12-14-2016, 02:47 PM
  4. Replies: 5
    Last Post: 12-10-2011, 11:49 AM
  5. Rounded number inside of text
    By Lockrin in forum Access
    Replies: 6
    Last Post: 01-27-2010, 12:26 PM

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