# 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)


---

# 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://documentation.astera.com/astera-data-stack-v6/functions/conversion/tostring-any-data-string-format.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.
