def numcell(text, value=None, convert='int', raw=None):
    if value is None:
        try:
            value = int(text) if convert == 'int' else float(text)
            if math.isnan(value):
                text = '---'
            elif not convert == 'int': # assume this is a percentage column
                text = '%.f%%' % value
        except __HOLE__:
            value = text
    return format_datatables_data(text=text, sort_key=value, raw=raw)
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/reports/util.py/numcell