# IFormatter

> Converts an object to a string.

## Definition

* **Type:** Interface
* **Namespace:** [Unity.SmartStrings.Core.Extensions](/engine/6000.7/script-reference/unity/smartstrings/core/extensions.md)
* **Assembly:** UnityEngine.SmartStringsModule

```csharp
public interface IFormatter
```

## Properties

| Property                                                                                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [CanAutoDetect](/engine/6000.7/script-reference/unity/smartstrings/core/extensions/iformatter/canautodetect.md) | Any extensions marked as [IFormatter.CanAutoDetect](/engine/6000.7/script-reference/unity/smartstrings/core/extensions/iformatter/canautodetect.md) will be called implicitly (when no formatter name is specified in the input format string). For example, "\{0:N2}" will implicitly call extensions marked as [IFormatter.CanAutoDetect](/engine/6000.7/script-reference/unity/smartstrings/core/extensions/iformatter/canautodetect.md). Implicit formatter invocations should not throw exceptions. With [IFormatter.CanAutoDetect](/engine/6000.7/script-reference/unity/smartstrings/core/extensions/iformatter/canautodetect.md) == `false`, the formatter can only be called by its name in the input format string. |
| [Name](/engine/6000.7/script-reference/unity/smartstrings/core/extensions/iformatter/name.md)                   | An extension can be explicitly called by using its name. For example, "\{0:list:N2}" will explicitly call the "list" extension.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

## Methods

| Method                                                                                                                  | Description                                                        |
| ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [TryEvaluateFormat](/engine/6000.7/script-reference/unity/smartstrings/core/extensions/iformatter/tryevaluateformat.md) | Writes the current value to the output using the specified format. |
