def formatCurVal(val):
    """
    Helper function for formatting current values to 3 significant digits, but 
    avoiding the use of scientific notation for display.  Also, integers are
    shown at full precision.
    """
    if val is None:
        return ''
    elif val == int(val):
        return '{:,}'.format(int(val))
    elif abs(val) >= 1000.0:
        return '{:,}'.format( int(float('%.4g' % val)))
    else:
        return '%.4g' % val