Results 1 to 5 of 5
  1. #1
    johnjenkin is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2023
    Posts
    2

    I have a table containing a calculated field : [charge] *0.0169 problem with decimal places


    the field is set up as:

    Expression: [charge]*0.0169
    Result type: Currency
    Format: Currency
    Decimal places: 2
    Text Align: General

    The field in the table is displayed to 2 decimal places but when I click on the field it shows the result to 4 decimal places. I have this field on a report but when i use the sum command the total reflects 4 decimal places.

    I want each calculation to be stored individually in the table as 2 decimal places, rounded.

  2. #2
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    The decimal places setting is only for display purposes, it doesn't change the data.

    You will need to force the result of the initial expression to round to two decimal places.
    That leads to a interesting question - What type of rounding do you want, as the inbuilt Access Round() function is about as much use as a chocolate teapot.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    You might want to consider whether or not you should be storing calculations at all.
    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.

  4. #4
    johnjenkin is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2023
    Posts
    2
    Thank you for your reply. You mention 'i would need to force the result of the initial expression to two decimal places'. As I cannot change 0.0169 so can you let me know how i would do this?

  5. #5
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    I'm not sure how complicated you can get in a calculated field in a table.

    You need something like

    Code:
     Int((([charge]*0.0169)*100)+0.5)/100
    This will force 2 decimal places with anything above .005 rounded up to the next value.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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. Replies: 1
    Last Post: 07-20-2017, 02:44 AM
  4. Decimal Places
    By momodoujimnjie in forum Access
    Replies: 1
    Last Post: 01-09-2013, 04:49 AM
  5. many decimal places in calculated fields
    By GordS in forum Access
    Replies: 1
    Last Post: 02-04-2009, 11:12 AM

Tags for this Thread

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