[Qgis-developer] Qt5 rounding issue spotted in the wild

Mathieu Pellerin nirvn.asia at gmail.com
Sun Sep 4 19:39:56 PDT 2016


Greetings,

While testing QGIS compiled against Qt5 5.6.1 (the version that will be
offered in Ubuntu's next release in a month or so), I ran into a rounding
issue, whereas the round() expression engine function simply fails to round
values to the stated number of decimals.

As seen in this screenshot[1], using this expression "round( 0.972743..., 2
)" to round the double value to two decimals returns 0.96999999999997.

Nyall says the issue has been fixed in Qt5 5.7. For Qt5 < 5.7, is there a
contingency plan for this problem? Could we get distributions to include a
fix in their 5.6.x packages (if that’s possible)?

Math

[1] http://i.imgur.com/7v2Z24Z.png
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160905/8d03c5ac/attachment.html>


More information about the Qgis-developer mailing list