[Qgis-developer] Strange behavior with round function of the expression builder

Giuseppe Sucameli sucameli at faunalia.it
Mon Nov 5 15:45:28 PST 2012


Hi Pedro,

On Sun, Nov 4, 2012 at 1:06 AM, Pedro Venâncio
<pedrongvenancio at yahoo.com> wrote:
> When the round is done to integer, everything seems going well. However, by introducing one or more decimal places, the results begin to be strange and often appears the default value -21474836.48.

-2147483648 is the min integer value, so probably
the way to round number fails somewhere.

I can see that each trailing '0' is removed, in addition
incrementing the number of decimal places the value
becomes negative:

"PM"  || '   ' || round( "PM", 6 ) || '   ' || round( "PM", 12 )

outputs

218317.69947   -2147.483648   -0.002147483648

> I'm using QGIS master (ubuntugis unstable) on Xubuntu 12.04 LTS.
>
> Anyone confirm?

I confirm, QGis master on Ubuntu 11.04.
Please, could you file a ticket?

Regards.

>
>
> Best regards,
> Pedro Venâncio
>
>
> [1] https://dl.dropbox.com/u/5772257/qgis/labeling_round_int.jpg
>
> [2] https://dl.dropbox.com/u/5772257/qgis/labeling_round_1_place.jpg
>
> [3] https://dl.dropbox.com/u/5772257/qgis/labeling_round_2_places.jpg
>
> [4] http://www.igeo.pt/produtos/cadastro/caop/download/CAOP20121_Shapes/Cont_AAd_CAOP20121.zip
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer



-- 
Giuseppe Sucameli - Faunalia


More information about the Qgis-developer mailing list