Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Apr 2001
    Posts
    122
    Thanks
    7
    Thanked 0 Times in 0 Posts

    How to Format A Decimal Value (Access 2000)

    This is probably a really easy question but I need to format a currency field with a fixed number of digits and no explicit decimal point, e.g. $123.45 should format as 0012345. The Access Help is not a lot of help with formatting. "0000000" results in 00000123 and "00000.00" results in 00123.45.

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    268
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How to Format A Decimal Value (Access 2000)

    If 123.45 should format as 0012345, what should 123.00 format as?

    If it should be displayed as 0012300, then the solution is just to multiply your values by 100 and display the result, with the format set to "0000000".

    If it should display as 0000123 then you will probably have to write a little vba function to return only the digits. To do this you could either multiply by 10 until the current value of the variable equals the truncated value of the variable, or treat the variable as a string and extract the characters one at a time, ignoring the "." character. I can't imagine why this would be the desired outcome, so I can't say which is preferable.

Posting Permissions

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