Rounding a number to the nearest 5 or 10 or X November 29, 2022 by Tarik It’s simple math. Given a number X and a rounding factor N, the formula would be: round(X / N)*N