Page 1 of 1

Forcing Currency to Display with Trailing Zeros

PostPosted: Mon Jan 20, 2014 11:44 pm
by Enigman
I am developing an app based on an Access database. I have setup the database directly in MS Access. I have two currency fields set to 2 decimal places.

No matter what I do to the data entered into those fields, if the number entered is an integer (whole dollar), the trailing zeros are wiped out. If I enter 2.1234, then it saves and displays 2.12 as expected. But if I enter 2.00 it saves and displays 2, without the zeros.

Does anyone know a way to force Access to save and display the trailing zeros, as in 2.00?

Thanks.

Re: Forcing Currency to Display with Trailing Zeros

PostPosted: Tue Jan 21, 2014 9:55 am
by Wrangler
Look at dbpsetfieldproperties. The help file explains what mask to enter. I believe it's #.00.

Re: Forcing Currency to Display with Trailing Zeros

PostPosted: Tue Jan 21, 2014 10:55 am
by Enigman
Wrangler wrote:Look at dbpsetfieldproperties. The help file explains what mask to enter. I believe it's #.00.

Knarly. That works. I missed that command entirely.

Thanks.

Re: Forcing Currency to Display with Trailing Zeros

PostPosted: Tue Jan 21, 2014 11:02 am
by Wrangler
Yup. One for the snippet bank. :)