Skip to content
Permalink
Browse files

Explain rationale for increasing field width for reals

  • Loading branch information
jdugge authored and nyalldawson committed Jun 19, 2020
1 parent 9b53ca6 commit 1dc05957adabf9bebb86f787c999537f0bf13395
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/providers/ogr/qgsogrprovider.cpp
@@ -1886,7 +1886,7 @@ bool QgsOgrProvider::addAttributeOGRLevel( const QgsField &field, bool &ignoreEr

gdal::ogr_field_def_unique_ptr fielddefn( OGR_Fld_Create( textEncoding()->fromUnicode( field.name() ).constData(), type ) );
int width = field.length();
// precision is only meaningful for OFTReal, don't alter the specified width for other types
// Increase width by 1 for OFTReal to make room for the decimal point
if ( type == OFTReal && field.precision() )
width += 1;
OGR_Fld_SetWidth( fielddefn.get(), width );

0 comments on commit 1dc0595

Please sign in to comment.
You can’t perform that action at this time.