[Qgis-user] Error in simple calculation in Field Calculator

magerlin MAP at ramboll.dk
Fri Feb 7 04:18:23 PST 2014


Are anybody able to get the right results when doing this calculation in
field calculator on a shape file:

FromToStop = 100000 * From_stop + To_stop

<http://osgeo-org.1560.x6.nabble.com/file/n5102486/Attribute_table.png> 
















I know there is a limit on 10 digits working with integers but using
integers (the two first columns) or real (the two next columns) makes only
one difference: 

Using real gives the right results as a start, but when the file is saved
and reopened the results are wrong (negative number from adding two positive
numbers!). I have also tested both integer and real for the result column
FromToSTop with no luck.

A test file is here:  Test.zip
<http://osgeo-org.1560.x6.nabble.com/file/n5102486/Test.zip>  

I suppose it is some kind of overflow but I get no error messages or
warnings at all.



-----
Regards Morten

Qgis 2.0.1 OSGeo,
Windows 7, 64bit
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Error-in-simple-calculation-in-Field-Calculator-tp5102486.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.



More information about the Qgis-user mailing list