https://issues.qgis.org/https://issues.qgis.org/favicon.ico2018-01-16T03:30:56ZQGIS Issue TrackingQGIS Application - Bug report #17861: SQLite REAL numbers displayed as too many digits in Attribute Tablehttps://issues.qgis.org/issues/17861?journal_id=858222018-01-16T03:30:56ZKory Robertskaptainkory@gmail.com
<ul></ul><p>OK, turns out both FLOAT and REAL show the same bug after all (after file reload?).</p> QGIS Application - Bug report #17861: SQLite REAL numbers displayed as too many digits in Attribute Tablehttps://issues.qgis.org/issues/17861?journal_id=863762018-01-30T11:24:41ZAlessandro Pasotti
<ul><li><strong>Assignee</strong> set to <i>Alessandro Pasotti</i></li></ul><p>Can you please attach a small spatialite test file with your tests?</p>
<p>What is the expected behavior?</p>
<p>Is there a way to automatically determine what is the right number of digits that has to be shown?</p>
<p>I mean that floating point numbers representation is not exact, converting back and forth from the DB backend to QGIS internal representation is always going to have some small rounding errors.</p> QGIS Application - Bug report #17861: SQLite REAL numbers displayed as too many digits in Attribute Tablehttps://issues.qgis.org/issues/17861?journal_id=863962018-01-31T00:36:13ZKory Robertskaptainkory@gmail.com
<ul></ul><blockquote>
<p>Can you please attach a small spatialite test file with your tests?</p>
</blockquote>
<p>I guess not since even the smallest spatialite file seems to exceed 5MB. I recreated the behavior by...</p>
<p>Layer -> Create Layer -> New Spatialite File...</p>
<p>Geometry as point, add new decimal number field ("field_a").</p>
<p>Now add point to the map, enter 34.05 as field_a.</p>
<p>Open attribute table.</p>
<p>Cell displays as 34.0499999999999997.</p>
<p>Click on cell in edit mode...back to 34.05.</p>
<hr />
<p>More testing...</p>
<p>QGIS DB Manager displays as 34.05.</p>
<p>spatialite_gui displays as 34.050000. <- Same "bug"????<br />(fresh database and table created by spatialite_gui shows same behavior)</p>
<p>sqlitemanager.xul (Firefox add-on) displays as 34.05.</p>
<p>DB Browser for SQLite displays as 34.05.</p>
<hr />
<blockquote>
<p>What is the expected behavior?</p>
</blockquote>
<p>Consistency, I guess. The number of decimals can be used to indicate level of precision, particularly if a field contains lat/long data. 34.05 means less is known about lat for location than 34.04999, for example.</p>
<p>Both QGIS attribute table and spatialite_gui have the same thing going on for some reason, but nothing else I was able to test handles the data display in that way. For everything else, if 34.05 is entered, then 34.05 is displayed...which, in my view, should be the expected behavior.</p> QGIS Application - Bug report #17861: SQLite REAL numbers displayed as too many digits in Attribute Tablehttps://issues.qgis.org/issues/17861?journal_id=864012018-01-31T08:31:45ZAlessandro Pasotti
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-5 priority- closed" href="/issues/18007">Bug report #18007</a>: QGIS 3 Vector data corruption when Adding a Point Feature</i> added</li></ul> QGIS Application - Bug report #17861: SQLite REAL numbers displayed as too many digits in Attribute Tablehttps://issues.qgis.org/issues/17861?journal_id=864032018-01-31T08:31:59ZAlessandro Pasotti
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-5 priority- closed" href="/issues/17878">Bug report #17878</a>: QGIS 3 Vector Layer Fields Garbled when Clicking the Toggle Editing Icon</i> added</li></ul> QGIS Application - Bug report #17861: SQLite REAL numbers displayed as too many digits in Attribute Tablehttps://issues.qgis.org/issues/17861?journal_id=864242018-02-01T06:52:45ZAnonymous
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" href="https://issues.qgis.org/projects/qgis/repository/revisions/1adc55f376c93dcc986b714c55de5db0c4de7948" title="[bugfix] Lower priority of range widget for doubles This was the root cause of several critical ...">qgis|1adc55f376c93dcc986b714c55de5db0c4de7948</a>.</p> QGIS Application - Bug report #17861: SQLite REAL numbers displayed as too many digits in Attribute Tablehttps://issues.qgis.org/issues/17861?journal_id=864282018-02-01T06:57:27ZAlessandro Pasotti
<ul></ul><p>Please test the latest commits, all tests should be done with a new project because the default widgets for fields have changed.</p> QGIS Application - Bug report #17861: SQLite REAL numbers displayed as too many digits in Attribute Tablehttps://issues.qgis.org/issues/17861?journal_id=864292018-02-01T06:57:34ZAlessandro Pasotti
<ul><li><strong>Resolution</strong> set to <i>fixed/implemented</i></li></ul>