• Status: Solved
• Priority: Medium
• Security: Public
• Views: 759

# can you round down in access

Hi Experts,

I have some calculations i'm doing based on values of other fields.  In one calculation, i need to round down to the nearest tenth.  This is my code, it rounds up.  Is there a way to do this rounding down.  I need the value to be 1.8 not 1.9

me.txtPoundsPerPieceFt.Value=Round(me.txtCutLength.Value / 12, 1)

where me.txtCutLength value = 22.625

Thanks :-)
Laura
0
linbayzak
1 Solution

Commented:
me.txtPoundsPerPieceFt.Value=Int(me.txtCutLength.Value / 1.2) / 10.0
0

Commented:
Use truncate instead of round
0

Author Commented:
thank you, works perfectly....now it didn't maintain my 10.0 on the end, just the 10, is that ok?  it did get the right number.  also, access didn't allow truncate to be used, sorry.  thanks again :-)

laura
0

Commented:
There are two good functions for this available in Excel.  You can use them by going to Tools -> References and add Microsoft Excel 12.0 Object Library and add these two functions to a module for your use.

Function RoundUp(arg1 As Double, arg2 As Double) As Double

RoundUp = Excel.WorksheetFunction.RoundUp(arg1, arg2)

End Function

Function RoundDown(arg1 As Double, arg2 As Double) As Double

RoundDown = Excel.WorksheetFunction.RoundDown(arg1, arg2)

End Function

Using RoundDown will give you exactly what you need.
0

## Featured Post

Tackle projects and never again get stuck behind a technical roadblock.