# To Unit

![](/files/-Ma6Cz1enGXiDJqnsVbU)

![](/files/-MihilGtIZGx6-p2K-bE) - [\[source code\]](https://github.com/ladybug-tools/ladybug-grasshopper/blob/master/ladybug_grasshopper/src//LB%20To%20Unit.py)

Convert a DataCollection to the input \_to\_unit.

### Inputs

* **data \[Required]**

A DataCollection to be converted to different units.

* **to\_unit**

Text representing the unit to convert the DataCollection to (eg. m2). Connect the \_data and see the all\_unit output for a list of all currently-supported units for a given collection. The default won't perform any unit conversion on the output data.

### Outputs

* **all\_unit**

A list of all possible units that the input \_data can be converted to.

* **data**

The converted DataCollection.


---

# 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://docs.ladybug.tools/ladybug-primer/components/4_extra/to_unit.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.
