Results 1 to 2 of 2
2002-05-09, 18:23 #1
- Join Date
- Apr 2001
- 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.
2002-05-09, 19:33 #2
- Join Date
- Dec 2000
- Vancouver, Br. Columbia, Canada
- 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.