Gets massaged value of the cell, converting datatypes to those known to Ruby (that includes
 stripping any special formatting from RichText).
164516
def value(args = {})
      r = self.raw_value

      case datatype
      when RubyXL::DataType::SHARED_STRING then workbook.shared_strings_container[r.to_i].to_s
      when RubyXL::DataType::INLINE_STRING then is.to_s
      when RubyXL::DataType::RAW_STRING    then raw_value
      else
        if is_date? then workbook.num_to_date(r.to_f)
        elsif r.is_a?(String) && (r =~ NUMBER_REGEXP) then # Numeric
          if $1 != '' then r.to_f
          else r.to_i
          end
        else r
        end
      end
    end
811686
public static Object getDataValue(CellDataType cellDataType, String value, SharedStringsTable sharedStringsTable, String numFmtString) {
		if (null == value) {
			return null;
		}

		Object result;
		switch (cellDataType) {
		case BOOL:
			result = (value.charAt(0) != '0');
			break;
		case ERROR:
			result = StrUtil.format("\\\"ERROR: {} ", value);
			break;
		case FORMULA:
			result = StrUtil.format("\"{}\"", value);
			break;
		case INLINESTR:
			result = new XSSFRichTextString(value).toString();
			break;
		case SSTINDEX:
			try {
				final int index = Integer.parseInt(value);
				result = new XSSFRichTextString(sharedStringsTable.getEntryAt(index)).getString();
			} catch (NumberFormatException e) {
				result = value;
			}
			break;
		case NUMBER:
			result = getNumberValue(value, numFmtString);
			break;
		case DATE:
			try {
				result = getDateValue(value);
			} catch (Exception e) {
				result = value;
			}
			break;
		default:
			result = value;
			break;
		}
		return result;
	}
1348360
def parse(value, name: nil)
      case type
      when :boolean
        [true, 'true', 't', '1'].include?(value)
      when :date, :datetime
        if (digits = value.to_s.scan(/(\d+)/).flatten).present?
          date = if digits.first.length == 4  # 2017-01-10
            Time.zone.local(*digits)
          else # 01/10/2016
            year = digits.find { |d| d.length == 4}
            digits = [year] + (digits - [year])
            Time.zone.local(*digits)
          end

          name.to_s.start_with?('end_') ? date.end_of_day : date
        end
      when :time
        if (digits = value.to_s.scan(/(\d+)/).flatten).present?
          now = Time.zone.now
          Time.zone.local(now.year, now.month, now.day, *digits)
        end
      when :decimal, :currency
        (value.kind_of?(String) ? value.gsub(/[^0-9|\-|\.]/, '') : value).to_f
      when :duration
        if value.to_s.include?('h')
          (hours, minutes) = (value.to_s.gsub(/[^0-9|\-|h]/, '').split('h'))
          (hours.to_i * 60) + ((hours.to_i < 0) ? -(minutes.to_i) : minutes.to_i)
        else
          value.to_s.gsub(/[^0-9|\-|h]/, '').to_i
        end
      when :effective_obfuscation
        klass.respond_to?(:deobfuscate) ? klass.deobfuscate(value) : value.to_s
      when :effective_roles
        EffectiveRoles.roles.include?(value.to_sym) ? value : EffectiveRoles.roles_for(value)
      when :integer
        (value.kind_of?(String) ? value.gsub(/\D/, '') : value).to_i
      when :percent # Integer * 1000. Percentage to 3 digits.
        value.kind_of?(Integer) ? value : (value.to_s.gsub(/[^0-9|\-|\.]/, '').to_f * 1000.0).round
      when :phone
        digits = value.to_s.gsub(/\D/, '').chars
        digits = (digits.first == '1' ? digits[1..10] : digits[0..9]) # Throw away a leading 1

        return nil unless digits.length == 10

        "(#{digits[0..2].join}) #{digits[3..5].join}-#{digits[6..10].join}"
      when :integer
        (value.kind_of?(String) ? value.gsub(/\D/, '') : value).to_i
      when :nil
        value.presence
      when :price # Integer * 100. Number of cents.
        value.kind_of?(Integer) ? value : (value.to_s.gsub(/[^0-9|\-|\.]/, '').to_f * 100.0).round
      when :string, :text, :email
        value.to_s
      when :belongs_to_polymorphic
        value.to_s
      when :belongs_to, :has_many, :has_and_belongs_to_many, :has_one, :resource, :effective_addresses  # Returns an Array of ints, an Int or String
        if value.kind_of?(Integer) || value.kind_of?(Array)
          value
        else
          digits = value.to_s.gsub(/[^0-9|,]/, '') # '87' or '87,254,300' or 'something'

          if digits == value || digits.length == 10
            if klass.respond_to?(:deobfuscate)
              digits.split(',').map { |str| klass.deobfuscate(str).to_i }
            else
              digits.split(',').map { |str| str.to_i }
            end
          else
            value.to_s
          end
        end
      else
        raise "unsupported type #{type}"
      end
    end
984522
def parse_cell(self, cell):
        
        field = ''
        if (isinstance(cell.value, (str, unicode)) and
            cell.value.startswith('{{') and
            cell.value.endswith('}}')):
            field = cell.value[2:-2].strip()
            value = ''
        else:
            value = cell.value

        return value, field
539450
def _sel_to_text(self, cell_range):
        """"""
        if not cell_range:
            return
        row_min, row_max, col_min, col_max = get_idx_rect(cell_range)
        if col_min == 0 and col_max == (self.model().cols_loaded-1):
            # we've selected a whole column. It isn't possible to
            # select only the first part of a column without loading more, 
            # so we can treat it as intentional and copy the whole thing
            col_max = self.model().total_cols-1
        if row_min == 0 and row_max == (self.model().rows_loaded-1):
            row_max = self.model().total_rows-1
        
        _data = self.model().get_data()
        if PY3:
            output = io.BytesIO()
        else:
            output = io.StringIO()
        try:
            np.savetxt(output, _data[row_min:row_max+1, col_min:col_max+1],
                       delimiter='\t', fmt=self.model().get_format())
        except:
            QMessageBox.warning(self, _("Warning"),
                                _("It was not possible to copy values for "
                                  "this array"))
            return
        contents = output.getvalue().decode('utf-8')
        output.close()
        return contents
684555
def raw_value(self) -> RawValue:
        """"""
        if isinstance(self.value, ObjectValue):
            return {m: self._member(m).raw_value() for m in self.value}
        if isinstance(self.value, ArrayValue):
            return [en.raw_value() for en in self]
        return self.schema_node.type.to_raw(self.value)
900838
function getCellWidthType( cell ) {
		var match = widthPattern.exec(
			cell.getStyle( 'width' ) || cell.getAttribute( 'width' ) );

		if ( match )
			return match[ 2 ];
	}
42927
@Override
  public boolean getBooleanCellValue() {
    CellType cellType = getCellType();
    switch(cellType) {
      case BLANK:
        return false;
      case BOOLEAN:
        return rawContents != null && TRUE_AS_STRING.equals(rawContents);
      case FORMULA:
        throw new NotSupportedException();
      default:
        throw typeMismatch(CellType.BOOLEAN, cellType, false);
    }
  }
488657
static String toValue(Cell cell, List<CellProcessor> cellProcessors) {
    String value;
    switch (cell.getCellTypeEnum()) {
      case BLANK:
        value = null;
        break;
      case STRING:
        value = cell.getStringCellValue();
        break;
      case NUMERIC:
        if (DateUtil.isCellDateFormatted(cell)) {
          try {
            // Excel dates are LocalDateTime, stored without timezone.
            // Interpret them as UTC to prevent ambiguous DST overlaps which happen in other
            // timezones.
            LocaleUtil.setUserTimeZone(LocaleUtil.TIMEZONE_UTC);
            Date dateCellValue = cell.getDateCellValue();
            value = formatUTCDateAsLocalDateTime(dateCellValue);
          } finally {
            LocaleUtil.resetUserTimeZone();
          }
        } else {
          // excel stores integer values as double values
          // read an integer if the double value equals the
          // integer value
          double x = cell.getNumericCellValue();
          if (x == Math.rint(x) && !Double.isNaN(x) && !Double.isInfinite(x))
            value = String.valueOf((long) x);
          else value = String.valueOf(x);
        }
        break;
      case BOOLEAN:
        value = String.valueOf(cell.getBooleanCellValue());
        break;
      case FORMULA:
        // evaluate formula
        FormulaEvaluator evaluator =
            cell.getSheet().getWorkbook().getCreationHelper().createFormulaEvaluator();
        CellValue cellValue;
        try {
          cellValue = evaluator.evaluate(cell);
        } catch (StackOverflowError e) {
          LOG.error("StackOverflowError evaluating formula", e);
          throw new RuntimeException(
              "Error evaluating formula, possibly due to deep formula nesting.");
        }
        switch (cellValue.getCellTypeEnum()) {
          case BOOLEAN:
            value = String.valueOf(cellValue.getBooleanValue());
            break;
          case NUMERIC:
            if (DateUtil.isCellDateFormatted(cell)) {
              try {
                // Excel dates are LocalDateTime, stored without timezone.
                // Interpret them as UTC to prevent ambiguous DST overlaps which happen in other
                // timezones.
                LocaleUtil.setUserTimeZone(LocaleUtil.TIMEZONE_UTC);
                Date javaDate = DateUtil.getJavaDate(cellValue.getNumberValue(), false);
                value = formatUTCDateAsLocalDateTime(javaDate);

              } finally {
                LocaleUtil.resetUserTimeZone();
              }
            } else {
              // excel stores integer values as double values
              // read an integer if the double value equals the
              // integer value
              double x = cellValue.getNumberValue();
              if (x == Math.rint(x) && !Double.isNaN(x) && !Double.isInfinite(x))
                value = String.valueOf((long) x);
              else value = String.valueOf(x);
            }
            break;
          case STRING:
            value = cellValue.getStringValue();
            break;
          case BLANK:
            value = null;
            break;
          default:
            throw new MolgenisDataException(
                "unsupported cell type: " + cellValue.getCellTypeEnum());
        }
        break;
      default:
        throw new MolgenisDataException("unsupported cell type: " + cell.getCellTypeEnum());
    }

    return AbstractCellProcessor.processCell(value, false, cellProcessors);
  }
905378
def to_internal_value(self, data):
        
        data = smart_text(data).strip()
        if len(data) > self.MAX_STRING_LENGTH:
            self.fail('max_string_length')

        try:
            value = decimal.Decimal(data)
        except decimal.DecimalException:
            self.fail('invalid')

        # Check for NaN. It is the only value that isn't equal to itself,
        # so we can use this to identify NaN values.
        if value != value:
            self.fail('invalid')

        # Check for infinity and negative infinity.
        if value in (decimal.Decimal('Inf'), decimal.Decimal('-Inf')):
            self.fail('invalid')

        return self.validate_precision(value)
1318429
function (cell) {
      var num = cell.match(/\d+$/),
          alpha = cell.replace(num, '');

      return {
        row: parseInt(num[0], 10) - 1,
        col: instance.utils.toNum(alpha)
      };
    }
436841
def _convert_type(self, data_type):
        '''
        
        '''
        if (data_type == 1) or (data_type == 41):
            dt_string = 'b'
        elif data_type == 2:
            dt_string = 'h'
        elif data_type == 4:
            dt_string = 'i'
        elif (data_type == 8) or (data_type == 33):
            dt_string = 'q'
        elif data_type == 11:
            dt_string = 'B'
        elif data_type == 12:
            dt_string = 'H'
        elif data_type == 14:
            dt_string = 'I'
        elif (data_type == 21) or (data_type == 44):
            dt_string = 'f'
        elif (data_type == 22) or (data_type == 45) or (data_type == 31):
            dt_string = 'd'
        elif (data_type == 32):
            dt_string = 'd'
        elif (data_type == 51) or (data_type == 52):
            dt_string = 's'
        return dt_string
1212552
def _cast(self, value):
        
        if self.type != 'text':
            value = utils.cast(self.TYPES.get(self.type)['cast'], value)
        return value
79484
function getFormattedValue(value) {
            if (valueFormatter !== null) {
                return valueFormatter(value);
            }

            let chosenValueFormatter = formatDecimalValue;

            if (!value) {
                return 0;
            }
            if (numberFormat !== null) {
                chosenValueFormatter = d3Format.format(numberFormat);
            } else if (isInteger(value)) {
                chosenValueFormatter = formatIntegerValue;
            }

            return chosenValueFormatter(value);
        }
772052
def process_cell(self, row, column, cell):
        
        value, field = self.parse_cell(cell)

        if value or field:
            return {'col':column, 'field':field, 'value':value}
        else:
            return {}
1094413
def cell_to_text(self):
        """"""
        if self.cell_type == 'markdown':
            # Is an explicit region required?
            if self.metadata or self.cell_reader(self.fmt).read(self.source)[1] < len(self.source):
                if self.metadata:
                    region_start = ['<!-- #region']
                    if 'title' in self.metadata and '{' not in self.metadata['title']:
                        region_start.append(self.metadata.pop('title'))
                    region_start.append(json.dumps(self.metadata))
                    region_start.append('-->')
                    region_start = ' '.join(region_start)
                else:
                    region_start = '<!-- #region -->'

                return [region_start] + self.source + ['<!-- #endregion -->']
            return self.source

        return self.code_to_text()
669165
def _convert_value(self, column, value):
        ''''''

        if isinstance(value, GObject.Value):
            return value
        return GObject.Value(self.get_column_type(column), value)