Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Explain rationale for increasing field width for reals
  • Loading branch information
jdugge authored and nyalldawson committed Jun 19, 2020
1 parent 9b53ca6 commit 1dc0595
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit 1dc0595

Please sign in to comment.