> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invoca.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Type Conversion Functions

> Conversion formulas convert a value to the data type a formula requires, such as boolean, date, double, integer, or string.

Some formulas require the input to be a particular data type. If you want to pass a value to a function but it's the wrong data type, convert it using a conversion formula.

## Conversion formulas

| Function     | Description                                                                                                                                                                                                                                 | Example                                   |
| :----------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------------- |
| `to_bool`    | Returns the input as a `boolean` data type (`true` or `false`)                                                                                                                                                                              | `to_bool (0) = false`                     |
| `to_date`    | Accepts a date represented as an integer or text string, plus a string parameter that can include `strptime` date formatting elements. Doesn't accept epoch-formatted dates, and doesn't accept datetime values — only month, day, and year | `to_date (date_sold, '%Y-%m-%d')`         |
| `to_double`  | Returns the input as a `double` data type                                                                                                                                                                                                   | `to_double ('3.14') = 3.14`               |
| `to_integer` | Returns the input as an integer                                                                                                                                                                                                             | `to_integer ('45') + 1 = 46`              |
| `to_string`  | Returns the input as a text string. To convert a date to a string, specify the date format in the second argument using [strftime](https://strftime.net/) formatting                                                                        | `to_string ( <date column>, "%Y-%m-%d" )` |

## Where to go next

* [Formula function reference](/s/article/formula-function-reference)
* [About date formulas](/s/article/about-date-formulas)
