# CurrencySFI class
{: .no_toc }

Formats a number as an amount of money for the **C** identifier.

**CurrencySFI** is a format identifier class. It implements [**IStringFormatIdentifier**](/tB/Packages/Contributed/Fmt/IStringFormatIdentifier.md) and matches the identifier **C** or **c** in any case. [**StringHelper**](/tB/Packages/Contributed/Fmt/StringHelper.md) registers it, so `{0:C}` in a call to [**StringFormat**](/tB/Packages/Contributed/Fmt/PublicEntryPoints/StringFormat.md) uses it for a numeric value. The class is predeclared, and its two members are reached through the interface.

## Output

The value is passed to **Format$**. Without a precision the format is `#,##0.00$`: thousands separators, two decimal places and a `$` after the number. With a precision *n* greater than zero the format has *n* decimal places instead. A precision of `0` is the same as none.

The `$` is a fixed character placed after the number. It is not the currency symbol of the system locale, and the identifier does not move it in front of the number. The thousands separator and the decimal point follow the Windows regional settings.

```tb check_build
Debug.Print StringFormat("{0:C}", 1234.5)     ' 1,234.50$
Debug.Print StringFormat("{0:C3}", 2.5)       ' 2.500$
Debug.Print StringFormat("{0:C0}", 17.63245)  ' 17.63$
Debug.Print StringFormat("{0:C}", -5)         ' -5.00$
```

The output shown is for an English (United States) system.

## Members

- **IsIdentifierMatch** returns **True** when the specifier's [**identifier**](/tB/Packages/Contributed/Fmt/StringFormatSpecifier/identifier.md) is `C` or `c`.
- **GetFormattedValue** returns the value formatted as described above. It reads the specifier's [**Precision**](/tB/Packages/Contributed/Fmt/StringFormatSpecifier/Precision.md).

Both are implemented as private members of the interface.

## See Also

- [IStringFormatIdentifier](/tB/Packages/Contributed/Fmt/IStringFormatIdentifier.md) interface -- the contract every format identifier class implements
- [DecimalSFI](/tB/Packages/Contributed/Fmt/DecimalSFI.md) class -- integer digits, padded with zeros
- [FixedPointSFI](/tB/Packages/Contributed/Fmt/FixedPointSFI.md) class -- a fixed number of decimal places, no separators
- [StringFormat](/tB/Packages/Contributed/Fmt/PublicEntryPoints/StringFormat.md) function -- formats a string using the identifiers
- [Fmt package](/tB/Packages/Contributed/Fmt/index.md) -- overview, with the table of identifiers
