---
title: "Discussion on \"Format numbers using compact notation\" | Hashnode"
description: "Discussion on \"Format numbers using compact notation\". const number = 2500000;\n\n// Basic usage\nconst formatter = new Intl.NumberFormat('en-US', {\n  notation: 'compact',\n  compactDisplay: 'short' // 'short' or 'long'\n});\n\nconsole.log(formatter.format(number)); // \"2.5M\""
url: "https://hashnode.com/posts/format-numbers-using-compact-notation/691fd2fa1c274a5c5ed84945"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Format numbers using compact notation](https://vijayt.hashnode.dev/format-numbers-using-compact-notation?utm_source=hashnode&utm_medium=feed)

const number = 2500000; // Basic usage const formatter = new Intl.NumberFormat('en-US', { notation: 'compact', compactDisplay: 'short' // 'short' or 'long' }); console.log(formatter.format(number)); // "2.5M"

Nov 21, 2025 · 1 min read · vijayt.hashnode.dev  
Read the article

## Written by

[Vijay Thirugnanam](https://hashnode.com/@vijayst)

@vijayst · Toronto, Canada

  
[View profile](https://hashnode.com/@vijayst)

Inference Service @ Cerebras

Engineer working in Cerebras. Latest work is Cerebras Inference. I love writing code in React, TypeScript, C++, Python. I spend most of my work hours tinkering with code.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
