If the field in the query is from a table you can set the format of the number and the number of decimal places in the table design mode. If the field is an expression, you could use the format function to force it to display only the number of decimal places you need. Alex Middleton
How can i get access to stop rounding my decimal places to 0, i have tried setting the format on the table (to currency - 2 d.places) and the control on the form (wich is an expression) to currency!
It still rounds off to zero !!
You can change the "#,##0.00" part depending on your specific needs as you may need millions or some other possible amount to be formatted. The above will work up to thousands (e.g. 1,234.56).
What Field Size is set for this number? I have tried using a Currency format with an integer and it always rounds the decimal part to zero. Ensure that the field size is a floating point variable, i.e. Single or Double. Alex Middleton
If you are doing monetary calculations be careful with the Round function. You may run into the problem of extra pennies showing up where you don't want them.
the Round function only hides the extra decimal places and those extra decimal places can show up in your final calculations as being a cent off. (Bookkeepers sometimes spend hours at $30.00 and hour trying to find the lost penny).
You may want to use the Fixed function instead of the Round function. The Fixed function REALLY sets the decimals to two places and you won't have those extra pennies showing up later to haunt you or the bookkeeper.
I could be wrong, but I had quite a problem recently in an accounting package which I developed, and it was with the Round function.
I think that you will find that if you perform further calculations with a previously rounded number, the calculation will be performed on the extended decimal places, not on the rounded (visable) decimal places.
If you go to the field of the rounded figure and place your cursor over the field you will notice that the extended decimals show up, if you do the same with a Fixed figure only the two decimal places will show.
I cleared up the problem by using the Fixed function and all the extra decimal problems were cleared up.
I am going to research this further to see if I am nuts or what <grin>.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.