> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/3.1/api/csharp/yarn/yarn.iyarnvalue/yarn.iyarnvalue.convertto.md).

# ConvertTo\<T>()

Method in [IYarnValue](/3.1/api/csharp/yarn/yarn.iyarnvalue.md)

## Summary

Converts this [IYarnValue](/3.1/api/csharp/yarn/yarn.iyarnvalue.md) to type `T` .

```csharp
public T ConvertTo<T>()
    where T : IConvertible;
```

## Type Parameters

| Name | Description             |
| ---- | ----------------------- |
| T    | The type to convert to. |

## Returns

A value of type T.
