# ToString (Any data, String format)

| **Name**    | ***ToString***                                                                                                                                      |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| Syntax      | ToString (Any data. String format)                                                                                                                  |
| Purpose     | To convert a value into a string with a given format.                                                                                               |
| Description | Returns string representation of the specified value. Returns null if value is null or format is invalid.                                           |
| Return Type | String                                                                                                                                              |
| Parameters  | <p>Data \[System.Object]</p><p>Format \[System.String] – Output format of the value. This method accepts any Microsoft.Net format specification</p> |

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FrkOHbDNap1cz2qhoXEE9%2F0.png?alt=media)

**Example**

We have an *Orders* dataset with a *Freight* field.

In this example we will attempt to convert the real values in this field to string values representing currency. We will map the *Freight* field to the *data* field of the function transformation object.

<figure><img src="https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FEANz1hTgLZYsc8KNOe0o%2F1.png?alt=media" alt=""><figcaption></figcaption></figure>

We will also use a *Variables* object to specify an acceptable Microsoft.Net format for currency.

Where,

*Format* = C

<figure><img src="https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FLY42hhS7jhssiB0a7S1M%2F2.png?alt=media" alt=""><figcaption></figcaption></figure>

In the output window, you can see that the provided data from the *Freight* field has been converted to a string representing currency.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FzvMU0FkkjeqyjZNnyrOk%2F3.png?alt=media)
