# Str, Str$
{: .no_toc }

Returns a string representation of a number.

Syntax:

- **Str$(** *number* **)**
- **Str(** *number* **)**

*number*
: *required* Any valid numeric expression.

The `$`-suffixed form returns a **String**; the unsuffixed form returns a **Variant** (**String**).

When numbers are converted to strings, a leading space is always reserved for the sign of *number*. If *number* is positive, the returned string contains a leading space and the plus sign is implied.

Use the [**Format**](/tB/Modules/Strings/Format.md) function to convert numeric values to be formatted as dates, times, or currency, or in other user-defined formats. Unlike **Str**, the **Format** function doesn't include a leading space for the sign of *number*.

> [!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"`, with no leading space, as 64-bit VBA does. A 32-bit build gives `" 0"`, as VB6 does.

> [!NOTE]
> The **Str** function recognizes only the period (`.`) as a valid decimal separator. When different decimal separators may be used (for example, in international applications), use [**CStr**](/tB/Modules/Conversion/CStr.md) to convert a number to a string.

### Common Errors

| Error | When |
|---|---|
| [94 (`&H5E`)](/Reference/Run-time-Errors.md#94), *Invalid use of Null* | **Str$** is given a *number* that is **Null** |

### Example

This example uses the **Str** function to return a string representation of a number. When a number is converted to a string, a leading space is always reserved for its sign.

```tb check_build
Dim MyString
MyString = Str(459)         ' Returns " 459".
MyString = Str(-459.65)     ' Returns "-459.65".
MyString = Str(459.001)     ' Returns " 459.001".
```

### See Also

- [CStr](/tB/Modules/Conversion/CStr.md), [Format](/tB/Modules/Strings/Format.md), [Hex](/tB/Modules/Conversion/Hex.md), [Oct](/tB/Modules/Conversion/Oct.md), [Val](/tB/Modules/Conversion/Val.md) functions
