<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Dave,</p>
<p>the proposal is that</p>
<p>QgsFields::precision() always returns -1 for doubles, correct?</p>
<p>Sounds fine to me, 0 might be a real value (0 digits after the
decimal point) while -1 clearly indicates an arbitrary precision
(as in double).</p>
<p>Matthias<br>
</p>
<br>
<div class="moz-cite-prefix">On 01/09/2018 03:34 PM, David Signer
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1515508442-1be59fa2f8f455ff5e7582365eff3cf3@opengis.ch">
<div>Hi all<br>
</div>
<div><br>
</div>
<div>We found different behaviors in qgsorgprovider and
qgsspatialiteprovider regarding the field with the type double.<br>
</div>
<div>In `QgsSpatiaLiteProvider::convertField` it's set to -1 when
it's 0 : <a
href="https://github.com/qgis/QGIS/blob/master/src/providers/spatialite/qgsspatialiteprovider.cpp#L82-L88"
moz-do-not-send="true">https://github.com/qgis/QGIS/blob/master/src/providers/spatialite/qgsspatialiteprovider.cpp#L82-L88</a><br>
</div>
<div>That's why I decided to change it in
`QgsSpatiaLiteProvider::loadFieldsAbstractInterface` as well.
The advantage would be, that we could recognize a field with
type double when the precision is not zero.<br>
</div>
<div>But when I checked qgsorgprovider, in
`QgsOgrProvider::convertField` the precision is not set (stays
what it is) in case of double: <a
href="https://github.com/qgis/QGIS/blob/master/src/providers/ogr/qgsogrprovider.cpp#L143-L145"
moz-do-not-send="true">https://github.com/qgis/QGIS/blob/master/src/providers/ogr/qgsogrprovider.cpp#L143-L145</a><br>
</div>
<div>I wonder why it's different and I ask you, if you mind, when
we just set the precision in any case to -1 when it's a double
value and it's not specified (means 0)?<br>
</div>
<div><br>
</div>
<div>ThanksĀ <br>
</div>
<div>Dave<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
QGIS-Developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre>
</blockquote>
<br>
</body>
</html>