[Qgis-user] Field calculator rounded to integer

Carlos Cerdán sig.upagu at gmail.com
Tue Oct 1 10:38:32 PDT 2013


Thank you Andre!!

So, in Field Calculator  [integer] / [Integer] = [integer]. Sorry, I didn't
know it.

But now I understand that another way could be: "buf_metros"/111120.0 or,
as you suggest: toreal("buff_metros")/111120   : difference is the decimal
separator.

Greetings,

Carlos Cerdán




2013/10/1 Andre Joost <andre+joost at nurfuerspam.de>

> Am 01.10.2013 17:28, schrieb Carlos Cerdán:
>
>  Field calculator rounded to integer
>>
>> Hi list, developers specially
>>
>> I have an issue with a points layer: It has a real-double field with 6
>> decimals that can't calculate decimals, just integers.
>>
>> For example in Field Calculator, I try to actualize the field "buf_grados"
>> with field "buff_metros"/111120 [1] to estimate a distance in meters to
>> degrees, but result is just integer (0.000000). If you divide per another
>> minor number (eg 10), result is not zero, but just integer.
>>
>>
>
>> It's a bug?
>>
>>
> For me, it works with QGIS 1.8.0 and 2.0.1.
>
> However, the buff_metros field is integer.So I used:
>
> toreal( "buff_metros" ) / 111120.0
>
> to have a division of real values.
>
> Greetings,
> André Joost
>
>
> ______________________________**_________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/qgis-user<http://lists.osgeo.org/mailman/listinfo/qgis-user>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20131001/4112c542/attachment.html>


More information about the Qgis-user mailing list