# Type Conversion Built-ins

| Function | Description | OPA | Wasm | [Swift](https://github.com/open-policy-agent/swift-opa) | [Java](https://github.com/open-policy-agent/java-opa-sdk) |
| --- | --- | --- | --- | --- | --- |
| `to_number` | `num := to_number(value)`  Converts value of type string, null or boolean to number. Numeric strings converts to the corresponding number when possible. Null and boolean `false` converts to 0 and boolean `true` to 1. Numbers are returned without conversion.  **Arguments:**  `value` (any<null, boolean, number, string>)  value to convert  **Returns:**  `num` (number)  the numeric representation of `value` | v0.17.0 | ✓ | 0.0.1 | 0.1.0 |