Microsoft Access Round a Number to the Nearest 10, 100, etc. (Rounding)

preview_player
Показать описание
In this Microsoft Access tutorial, I'm going to show you how to round any number to the nearest 10, 100, etc. You'll also see how to round up, down, and avoid "banker's rounding."

FORMULAS:
R: 10 - round to the nearest 10
Nearest: [R]*(Round([X]/[R],0))
RoundDown: [R]*Int([X]/[R])
RoundUp: -1*[R]*Int([X]/(-1*[R]))
NoBankers: [R]*(Round(([X]+0.00001)/[R],0))

RESOURCES:

ROUND Function Covered In:

Рекомендации по теме
Комментарии
Автор

Thank you very much sir Richard for your immediate answer regarding my request. I tried it already and it was okey. GOD BLESS YOU AND GOOD HEALTH....

dindomendoza
Автор

very helpful as I needed to round up some things to the nearest 5 and also round down. I also turned them into a function so I dont have to keep remembering the formulas.

Function Round05(sValue As Integer) As Single
'round down to nearest 5
'[R]*Int([X]/[R])

Round05 = 5 * Int(sValue / 5)
End Function

drb
Автор

Thanks for the detailed explanation. How can i use two functions together. example: if number <145 rounddown 140 and number >=145 roundup 150

ozkanozbay