'Given a value, infer type and display options.'

def bind_value(self, value):

    self._data_type = self.data_type_for_value(value)
    if (value is None):
        self.set_value_explicit('', self.TYPE_NULL)
        return True
    elif (self._data_type == self.TYPE_STRING):
        percentage_search = self.RE_PATTERNS['percentage'].match(value)
        if (percentage_search and (value.strip() != '%')):
            value = (float(value.replace('%', '')) / 100.0)
            self.set_value_explicit(value, self.TYPE_NUMERIC)
            self._set_number_format(NumberFormat.FORMAT_PERCENTAGE)
            return True
        time_search = self.RE_PATTERNS['time'].match(value)
        if time_search:
            sep_count = value.count(':')
            if (sep_count == 1):
                (hours, minutes) = [int(bit) for bit in value.split(':')]
                seconds = 0
            elif (sep_count == 2):
                (hours, minutes, seconds) = [int(bit) for bit in value.split(':')]
            days = (((hours / 24.0) + (minutes / 1440.0)) + (seconds / 86400.0))
            self.set_value_explicit(days, self.TYPE_NUMERIC)
            self._set_number_format(NumberFormat.FORMAT_DATE_TIME3)
            return True
    if (self._data_type == self.TYPE_NUMERIC):
        if (isinstance(value, datetime.date) and (not isinstance(value, datetime.datetime))):
            value = datetime.datetime.combine(value, datetime.time())
        if isinstance(value, datetime.datetime):
            value = SharedDate().datetime_to_julian(date=value)
            self.set_value_explicit(value, self.TYPE_NUMERIC)
            self._set_number_format(NumberFormat.FORMAT_DATE_YYYYMMDD2)
            return True
    self.set_value_explicit(value, self._data_type)
