public decimal GetDecimal() { if (_cacheSet) { return((decimal)_dataCache); } string str = _dataAsString; if (!DbfFieldType.IsFloatingPoint(_fieldType)) { throw new DbfColumnTypeMismatchException(_fieldType, str, typeof(decimal)); } decimal result; if (!decimal.TryParse(str, NumberStyles.Number, null, out result)) { throw new DbfColumnTypeMismatchException(_fieldType, str, typeof(decimal)); } _cacheSet = true; _dataCache = result; return(result); }
internal void AddHeader(DbfHeader header) { if (header == null) { return; } if (DbfFieldType.IsFloatingPoint(header.FieldType) && header.NumDecimalPlaces == 0) { header.FieldType = DbfFieldType.Integer; } _headers.Add(header); }