> 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/fr/astuces-rapides-sig/qgis-convertir-des-valeurs-de-chaine-en-valeurs-numeriques-dans-le-shapefile.md).

# QGIS : convertir des valeurs de chaîne en valeurs numériques dans le shapefile

Dans QGIS, vous pouvez convertir une chaîne de caractères en nombre à l’aide de l’outil « Calculatrice de champs ». Commencez par ouvrir la table attributaire de la couche que vous souhaitez modifier. Ensuite, cliquez sur le bouton « Ouvrir la calculatrice de champs ». Dans la zone « Expression », saisissez « to\_real( » suivi du nom du champ contenant la chaîne que vous voulez convertir, puis la parenthèse fermante. Par exemple, pour convertir un champ texte nommé « string\_field » en champ numérique, saisissez « to\_real("string\_field") » dans la zone Expression. Vous pouvez aussi modifier le nom du champ de sortie et le type de données en sélectionnant les options appropriées. Enfin, cliquez sur « OK » pour terminer la conversion. Le champ texte d’origine restera dans la table attributaire, tandis que le nouveau champ numérique sera ajouté à la table.

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

1. Ouvrir « Propriétés »
2. Aller à « Calculatrice de champs »
3. Cocher « Mettre à jour le champ existant »
4. to\_real("attributeName")
5. Enregistrer les modifications
6. Répétez la même opération pour chaque attribut

   <figure><img src="/files/5252672fe2d1447ccf58cc0c4eee0344568315bc" 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/fr/astuces-rapides-sig/qgis-convertir-des-valeurs-de-chaine-en-valeurs-numeriques-dans-le-shapefile.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.
