# CStr
{: .no_toc }

Coerces an expression to a **String**.

Syntax: **CStr(** *expression* **)**

*expression*
: *required* Any valid expression.

The return type is **String**. The result depends on the type of *expression*:

| If *expression* is | CStr returns                                                  |
|--------------------|---------------------------------------------------------------|
| **Boolean**        | A string containing `"True"` or `"False"`.                    |
| **Date**           | A string containing a date in the system's short date format. |
| **Empty**          | A zero-length string (`""`).                                  |
| **Error**          | A string containing the word `Error` followed by the error number. |
| Other numeric      | A string containing the number.                               |

**CStr** is the internationally aware alternative to [**Str**](/tB/Modules/Conversion/Str.md) for converting a number to a string. **CStr** recognizes different decimal separators properly, depending on the system's locale setting.

> [!NOTE]
> A 64-bit build converts a negative zero of type **Single** or **Double** (a value that equals 0 and has its sign bit set) to `"-0"`, as 64-bit VBA does. A 32-bit build gives `"0"`, as VB6 does. The same happens when such a value is joined to a string with `&`.

### Common Errors

| Error | When |
|---|---|
| [94 (`&H5E`)](/Reference/Run-time-Errors.md#94), *Invalid use of Null* | *expression* is **Null** |

### Example

This example uses the **CStr** function to convert a numeric value to a **String**.

```tb check_build
Dim MyDouble, MyString
MyDouble = 437.324                       ' MyDouble is a Double.
MyString = CStr(MyDouble)                ' MyString contains "437.324".
```

### See Also

- [CBool](/tB/Modules/Conversion/CBool.md), [CByte](/tB/Modules/Conversion/CByte.md), [CCur](/tB/Modules/Conversion/CCur.md), [CDbl](/tB/Modules/Conversion/CDbl.md), [CInt](/tB/Modules/Conversion/CInt.md), [CLng](/tB/Modules/Conversion/CLng.md), [CSng](/tB/Modules/Conversion/CSng.md), [CVar](/tB/Modules/Conversion/CVar.md) functions
- [Str](/tB/Modules/Conversion/Str.md), [Format](/tB/Modules/Strings/Format.md) functions
