# Type

Muninn can turn data into the desired types during the parsing stage.

#### Available Types

* number
* float
* boolean
* array

**Array**

{% content-ref url="/pages/-Me4NbgpGFclQEJc3ReS" %}
[Array](/muninn/config/array.md)
{% endcontent-ref %}

#### Number

{% code title="HTML" %}

```markup
<div class="parent">
  <div class="year">1984</div>
</div>

```

{% endcode %}

{% code title="Config" %}

```javascript
{
    "year": {
        "selector": ".year",
        "type": "number"
    },
}

// or use this shortcut

{
    "year": ".year | number"
}
```

{% endcode %}

{% code title="Output" %}

```javascript
{
    "year": 1984 
}
```

{% endcode %}

#### Float

{% code title="HTML" %}

```markup
<div class="parent">
  <div class="price">2.99</div>
</div>

```

{% endcode %}

{% code title="Config" %}

```javascript
{
    "price": {
        "selector": ".price",
        "type": "float"
    },
}

// or use this shortcut

{
    "price": ".price | float"
}
```

{% endcode %}

{% code title="Output" %}

```javascript
{
    "price": 2.99
}
```

{% endcode %}

#### Boolean

For various reasons, we may want to convert a value to the Boolean type. Let's start with an example we check that the content of the element is empty.

{% code title="HTML" %}

```markup
<div class="parent">
  <div class="content-1">Lorem Ipsum</div>
  <div class="content-2"></div>
</div>

```

{% endcode %}

{% code title="Config" %}

```javascript
{
    "isExistContent1": {
        "selector": ".content-1",
        "type": "boolean"
    },
    "isExistContent2": {
        "selector": ".content-2",
        "type": "boolean"
    },
}

// or use this shortcut

{
    "isExistContent1": ".content-1 | boolean",
    "isExistContent2": ".content-2 | boolean"
}
```

{% endcode %}

{% code title="Output" %}

```javascript
{
    "isExistContent1": true,
    "isExistContent2": false,
}
```

{% endcode %}


---

# Agent Instructions: 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:

```
GET https://wopehq.gitbook.io/muninn/config/type.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
