> For the complete documentation index, see [llms.txt](https://docs.geopard.tech/geopard-tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.geopard.tech/geopard-tutorials/swe/snabba-gis-tips/qgis-andra-strangvarden-till-numeriska-varden-i-shapefilen.md).

# QGIS: Ändra strängvärden till numeriska värden i shapefilen

I QGIS kan du konvertera en sträng till ett tal med verktyget "Fältkalkylatorn". Öppna först attributtabellen för det lager du vill ändra. Klicka sedan på knappen "Öppna fältkalkylatorn". I rutan "Uttryck" skriver du "to\_real(" följt av namnet på fältet som innehåller strängen du vill konvertera, och avslutande parentes. Till exempel, om du vill konvertera ett strängfält som heter "string\_field" till ett numeriskt fält, skriver du "to\_real("string\_field")" i rutan Uttryck. Du kan också ändra namnet på utdatafältet och datatypen genom att välja lämpliga alternativ. Klicka till sist på "OK" för att slutföra konverteringen. Det ursprungliga strängfältet finns kvar i attributtabellen, medan det nya numeriska fältet läggs till i tabellen.

<figure><img src="/files/8a3d5485a73232fd748f7a7bbf61228bc44adb40" alt=""><figcaption></figcaption></figure>

1. Öppna "Egenskaper"
2. Gå till "Fältkalkylatorn"
3. Markera "Uppdatera befintligt fält"
4. to\_real("attributeName")
5. Spara ändringar
6. Upprepa samma sak för varje attribut

   <figure><img src="/files/f72e7455f38ae75f33bb6ca96a1f5ecf1e82a5d4" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.geopard.tech/geopard-tutorials/swe/snabba-gis-tips/qgis-andra-strangvarden-till-numeriska-varden-i-shapefilen.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
