def value_to_print(value, optype):
    """String of code that represents a value according to its type

    """
    if value is None:
        return 'NULL'
    if optype == 'numeric':
        return value
    return u"'%s'" % value.replace("'", "\\'")
