# Format Specifier

*noun*

say it: **“FOR-mat SPES-ih-fy-er”** **/ˈfɔːrmæt ˈspɛsɪfaɪər/**

A short code after a colon, such as F2 or N0, that sets how a number or date is shown in a string.

## What is **Format Specifier** in C#?

**Format Specifier** — A short code after a colon in an interpolated string that sets how a value is shown: `F2` for two decimal places, `N0` for thousands separators, `C` for currency and `P` for a percent.

```csharp
decimal price = 1234.5m;
Console.WriteLine($"{price:F2}"); // 1234.50
Console.WriteLine($"{price:N0}"); // 1,235
```

## In a sentence

- “Adding the **format specifier** F2 made every price show two decimal places.”

Level: Apprentice · [More C# terms at this level](https://www.ask-codey.com/glossary?category=c-sharp&level=2)

Updated: October 28, 2026

Source: https://www.ask-codey.com/glossary/format-specifier
