# 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://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/0%20\(25\).png)

**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://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/1%20(26).png" 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://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/2%20(26).png" 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://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/3%20\(17\).png)
