(function from pyomo.contrib.gdpopt.util)
pyomo.contrib.gdpopt.util
Fixes the discrete variable var to val, rounding to the nearest integer or not, depending on if rounding is specified in config and what the integer tolerance is.