[GIS] New values created with QGIS field calculator become null upon saving

field-calculatorqgis

I'm having a problem with QGIS. I'm trying to create a new column in the attribute table for a shapefile. The numbers in the fourth column (see screenshots) are currently strings, so I want to convert them into real numbers. This seems to work just fine until I save my edits. Then all the values in the new column become null.

enter image description here
enter image description here

It looks like a couple of other people have had this problem (here and here) but they seemed to solve the problem by expanding the width of the output field (from 10 to 20). I tried that, and it didn't make a difference.

Can anyone help?

Best Answer

I had the same problem. The best way of it is running Processing Toolbox -> Refactor fields where just in case you can set up the total length of your column (regardless of its type).

enter image description here

enter image description here

Related Question