Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Markdown Digit FormatterNew to Visual Studio Code? Get it now.
Markdown Digit Formatter

Markdown Digit Formatter

yusu79

|
6 installs
| (0) | Free
Format integers in VS Code Markdown previews using explicit or document-wide locale settings.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Markdown Digit Formatter

English | 日本語 | 简体中文 | 한국어 | 繁體中文

Version Visual Studio Code License

Formats locale-marked integers in the Visual Studio Code Markdown preview using markdown-it-digit.

The extension changes only the rendered preview. It does not modify the Markdown source in the editor.

Installation

Search for "Markdown Digit Formatter" in the Visual Studio Code Extensions view.

Usage

Open a Markdown file and write an integer using the following syntax:

$<number>${<locale>}

For example:

$1234567${en}

The preview renders this as 1,234,567, while the source remains unchanged.

Number formatting examples with Markdown Digit Formatter

<number> must contain one or more ASCII digits (0–9). Leading zeros are preserved, and locale identifiers are case-sensitive.

Document-wide automatic formatting

Set a default locale in VS Code settings to automatically format ordinary numbers throughout Markdown documents. Automatic formatting is disabled by default.

{
    "markdownDigit.locale": "jp",
    "markdownDigit.minDigits": 4
}

markdownDigit.locale accepts en, in, jp, cn, kr, or tw. Select the empty value to disable automatic formatting.

markdownDigit.minDigits controls the minimum number of digits to format and defaults to 4. For example, with locale: en and minDigits: 4, 999 remains unchanged while 1000 becomes 1,000.

To override these defaults for one document, add YAML Front Matter at the start of the Markdown file:

---
markdown:
  digit:
    locale: jp
    minDigits: 4
---

In this document, an ordinary 123456789 is rendered as 1億2345万6789. YAML Front Matter is read only at the start of a document. Invalid YAML and Front Matter without markdown.digit are ignored, so the VS Code settings remain in effect.

Settings are resolved per property in this order:

Explicit marker
> YAML Front Matter
> VS Code settings
> No setting

Even when document-wide formatting is active, an explicit locale such as $1234567${en} overrides it for that number. Use $1234567${raw} to remove the marker and render 1234567 without formatting.

Supported locales

Locale Preview output for $123456789${locale}
en 123,456,789
in 12,34,56,789
jp 1億2345万6789
cn 1亿2345万6789
kr 1억2345만6789
tw 1億2345萬6789

The East Asian units are rendered as subscript text in the Markdown preview. jp, cn, kr, and tw are format identifiers defined by markdown-it-digit; they are not ISO language codes or BCP 47 language tags.

Content that is not transformed

The extension leaves the following content unchanged:

  • ordinary numbers when no locale is configured for automatic formatting
  • invalid syntax and unsupported or incorrectly cased locales
  • fenced and indented code blocks
  • inline code
  • URLs and Markdown link destinations
  • HTML attributes and HTML comments
  • syntax escaped with a Markdown backslash

For complete parsing and formatting behavior, see the markdown-it-digit documentation and its specification.

Requirements

  • Visual Studio Code 1.125.0 or later

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft