Decimal Place problem

G

Guest

I have a query which has a column that contains a currency value. This is a
calculated field and is not stored in ant table. I have the Decimal place
property to display 2 decimal places. However I want it to store as two
decimal places as well as displaying 2 decimal places, (ie when you click in
one of the currency values you can see that there are more than two decimal
places)Can anyone help?
 
G

Guest

Hi Niall,

This is one way to do it. Try Round() function.

Round(expression [,numdecimalplaces])

Hope this helps.
 
W

Wayne Morgan

You need to add one more calculation to round off the value. The built in
Round function uses "banker's rounding" where .5 rounds to the nearest even
number instead of rounding up. If you want to round to two decimals and have
..5 round up, you'll need to create your own function.

Example:

Public Function MyRound(curInput As Currency) As Currency
MyRound = Int(curInput * 100 + 0.5) / 100
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top