Rounding Issue

tikrit

New member
Local time
Yesterday, 16:07
Joined
Dec 29, 2012
Messages
6
Hello,
I have the following code written by VBA in MS Access 2010. This code prints in the Label1.caption the number of this equation.
the_average = CDbl(TextBox1.Text) * 2 / 3 + CDbl(TextBox2.Text) / 3
the_average = Format(the_average, "#.###")
Label1.caption= the_average
Some of the operations have more than three decimal places. This code rounds the numbers when printing them in the caption of the label. For example if I have 1.66666666, it shows 1.667 and I want it to show 1.666 without rounding.
How can I do that?
Thanks in advance
 
Try multiplying times 1000, applying the Int() function, then dividing by 1000.
 

Users who are viewing this thread

Back
Top Bottom