ToString
ToString function converts any type of input value to text form like a string.
Syntax
ToString(text,precision)
Enabled For
For a description of the business object categories, see Notes on "Enabled For".
| Business Object Category | Yes/No |
|---|---|
| Business Rules: Before-Save Rules | Yes |
| Business Rules: Calculation Rules (After Save, with or without Also Recalculate on Load) | Yes |
| Business Rules: Calculation Rules (Before Save or Always, without Also Recalculate On Load) | Yes |
| Business Rules: Calculation Rules (Before Save or Always, with Recalculate On Load) | Yes |
| Business Rules: Editing Rules | Yes |
| Business Rules: Initialization Rules | Yes |
| Business Rules: Read Only Rules | Yes |
| Business Rules: Required Rules | Yes |
| Business Rules: Validation Rules | Yes |
| Client Expressions | Yes |
| Object Permissions | Yes |
| Services | Yes |
| LDAP | Yes |
| Mobile | Yes |
| Quick Actions (except UI Quick Actions) | Yes |
| UI Quick Actions | Yes |
| Reports | Yes |
| Search/Dashboard without field references | Yes |
| Search/Dashboard with field references | Yes |
Parameters
| Parameter | Description |
|---|---|
|
text |
The value to convert to a text value. |
|
precision |
(Optional) The number of decimal places returned if the text parameter is a number or a currency. The application ignores the precision parameter for values that are not a number or currency.
The maximum precision for numbers is up to 15 digits in total (including digits before and after the decimal point). Values exceeding this limit result in an incorrect number. |
Return Value
String - text value.
If the text parameter is a text value, returns the text unchanged.
Example
$(ToString(CreatedDateTime))
This returns the text value of the CreatedDateTime field.
$(ToString(price, 2))
This returns a currency value to two decimal places. An example is 3.45 USD.