Option Compare Database
Option Explicit

' ** Access Toolbox Module **
' on 2017-02-28,
' @author: Olivier Massot
' V 1.0

' Math operations

Public Function is_pair(ByVal number As Long) As Boolean
  is_pair = (number Mod 2 = 0)
End Function

Public Function round_up(ByVal val As Variant, Optional ByVal nb_dec As Integer = 0) As Variant
   round_up = -Int(-val * 10 ^ nb_dec) / 10 ^ nb_dec
End Function
 
Public Function round_down(ByVal val As Variant, Optional ByVal nb_dec As Integer = 0) As Variant
   round_down = Int(val * 10 ^ nb_dec) / 10 ^ nb_dec
End Function