How to choose between 1K and 1 thousand in compact format
Use the compactDisplay option to control whether compact numbers display as abbreviations or spelled-out words
Introduction
When you format large numbers with compact notation, the number 1500 becomes 1.5K by default. This abbreviated format works well in space-constrained interfaces like mobile screens and dashboard cards. However, some contexts benefit from spelling out the magnitude. The same number can display as 1.5 thousand instead of 1.5K, trading brevity for clarity.
JavaScript's Intl.NumberFormat provides the compactDisplay option to control this choice. You can select between short display, which uses abbreviations like K, M, and B, or long display, which spells out the magnitude as thousand, million, and billion. This option gives you precise control over how compact numbers appear to users.
What the compactDisplay option controls
The compactDisplay option only works when you set notation to "compact". It accepts two values: "short" and "long". The short value produces abbreviated output like 1.5K, while the long value produces spelled-out output like 1.5 thousand.
const shortFormatter = new Intl.NumberFormat("en-US", {
notation: "compact",
compactDisplay: "short"
});
console.log(shortFormatter.format(1500));
// Output: "1.5K"
const longFormatter = new Intl.NumberFormat("en-US", {
notation: "compact",
compactDisplay: "long"
});
console.log(longFormatter.format(1500));
// Output: "1.5 thousand"
The compactDisplay option defaults to "short" if you omit it. This means compact notation uses abbreviations unless you explicitly request long display.
Format numbers with short compact display
Short compact display uses single-letter abbreviations to represent magnitude. This format minimizes horizontal space while maintaining readability.
const formatter = new Intl.NumberFormat("en-US", {
notation: "compact",
compactDisplay: "short"
});
console.log(formatter.format(1500));
// Output: "1.5K"
console.log(formatter.format(2400000));
// Output: "2.4M"
console.log(formatter.format(7800000000));
// Output: "7.8B"
console.log(formatter.format(5600000000000));
// Output: "5.6T"
The formatter automatically selects the appropriate abbreviation based on the number's magnitude. Thousands use K, millions use M, billions use B, and trillions use T.
Short display works well when you need to fit numbers into tight spaces. Mobile interfaces, data tables, chart labels, and dashboard cards benefit from the compact width of abbreviated numbers.
Format numbers with long compact display
Long compact display spells out the magnitude word instead of abbreviating it. This format provides more clarity at the cost of additional horizontal space.
const formatter = new Intl.NumberFormat("en-US", {
notation: "compact",
compactDisplay: "long"
});
console.log(formatter.format(1500));
// Output: "1.5 thousand"
console.log(formatter.format(2400000));
// Output: "2.4 million"
console.log(formatter.format(7800000000));
// Output: "7.8 billion"
console.log(formatter.format(5600000000000));
// Output: "5.6 trillion"
The formatter uses the full magnitude word, making the number's scale immediately obvious without requiring users to interpret abbreviations. Users who are unfamiliar with K, M, B notation will find thousand, million, billion more accessible.
Long display works well in contexts where clarity matters more than space. Educational content, financial reports, accessibility-focused interfaces, and formal documentation benefit from spelled-out magnitudes.
Compare short and long compact display
The difference between short and long display becomes clear when you format the same numbers with both options.
const shortFormatter = new Intl.NumberFormat("en-US", {
notation: "compact",
compactDisplay: "short"
});
const longFormatter = new Intl.NumberFormat("en-US", {
notation: "compact",
compactDisplay: "long"
});
const numbers = [1500, 45000, 2400000, 950000000];
numbers.forEach(num => {
console.log(`${num}:`);
console.log(` Short: ${shortFormatter.format(num)}`);
console.log(` Long: ${longFormatter.format(num)}`);
});
// Output:
// 1500:
// Short: 1.5K
// Long: 1.5 thousand
// 45000:
// Short: 45K
// Long: 45 thousand
// 2400000:
// Short: 2.4M
// Long: 2.4 million
// 950000000:
// Short: 950M
// Long: 950 million
Short display consistently uses fewer characters. The abbreviation K takes one character, while thousand takes eight characters including the space. This difference multiplies when displaying many numbers in tables or lists.
Long display provides more context for each number. Users can read 2.4 million without needing to decode what M represents. This explicitness helps users who are less familiar with abbreviated number formats.
How compact display varies across languages
Both short and long compact display adapt to the locale you specify. Different languages use different abbreviations and magnitude words.
const locales = ["en-US", "fr-FR", "de-DE", "es-ES"];
locales.forEach(locale => {
const shortFormatter = new Intl.NumberFormat(locale, {
notation: "compact",
compactDisplay: "short"
});
const longFormatter = new Intl.NumberFormat(locale, {
notation: "compact",
compactDisplay: "long"
});
console.log(`${locale}:`);
console.log(` Short: ${shortFormatter.format(2400000)}`);
console.log(` Long: ${longFormatter.format(2400000)}`);
});
// Output:
// en-US:
// Short: 2.4M
// Long: 2.4 million
// fr-FR:
// Short: 2,4 M
// Long: 2,4 millions
// de-DE:
// Short: 2,4 Mio.
// Long: 2,4 Millionen
// es-ES:
// Short: 2,4 M
// Long: 2,4 millones
French adds an s to make millions plural. German uses Mio. as the short form and Millionen as the long form. Spanish uses millones for the plural. Each language applies its own grammatical rules to both short and long formats.
The formatter handles these variations automatically based on the locale. You do not need to maintain separate formatting logic for each language.
Asian languages often use completely different number grouping systems.
const jaFormatter = new Intl.NumberFormat("ja-JP", {
notation: "compact",
compactDisplay: "short"
});
console.log(jaFormatter.format(15000000));
// Output: "1500万"
const zhFormatter = new Intl.NumberFormat("zh-CN", {
notation: "compact",
compactDisplay: "short"
});
console.log(zhFormatter.format(15000000));
// Output: "1500万"
Japanese and Chinese group by ten thousand rather than one thousand. The character 万 represents ten thousand, so 15,000,000 becomes 1500万 rather than 15M. The Intl API handles these fundamental differences in number systems automatically.
When to use short compact display
Short compact display works best in space-constrained contexts where every character matters. Mobile interfaces have limited horizontal space, making abbreviated numbers essential for fitting content on screen.
Data tables displaying multiple numbers benefit from uniform width. Using 1.5K, 2.4M, and 7.8B keeps columns aligned and prevents wrapping. The consistent abbreviation format helps users scan columns of numbers quickly.
Dashboard cards and metrics panels use short display to maximize information density. A dashboard showing follower counts, view counts, and engagement metrics across multiple platforms needs compact formatting to fit all metrics on screen simultaneously.
Chart axes and labels require minimal text to avoid overlapping or crowding. Using 1.5M instead of 1.5 million keeps axis labels readable without rotating or truncating them.
Interactive maps and data visualizations benefit from short display when showing numbers as overlays or tooltips. The abbreviated format prevents text from obscuring underlying content.
When to use long compact display
Long compact display works best when clarity and accessibility matter more than space efficiency. Educational content teaching users about large numbers benefits from spelling out magnitudes. Students learning about population statistics or economic figures need explicit magnitude words to understand the scale.
Financial reports and formal documents use long display to avoid ambiguity. A business report stating 2.4 million in revenue is clearer than 2.4M, especially for readers who might not be familiar with abbreviation conventions.
Accessibility-focused interfaces benefit from long display because screen readers pronounce spelled-out words more naturally. A screen reader announcing 1.5 thousand sounds more natural than 1.5K, which might be read as one point five kay or one point five K.
Print layouts have more horizontal space than digital interfaces, making long display practical. Printed reports, infographics, and presentations can accommodate the additional characters without causing layout problems.
Contexts where users might be unfamiliar with abbreviations need long display. International audiences, non-technical users, or users with lower digital literacy find thousand, million, and billion more recognizable than K, M, and B.
Combine compact display with other formatting options
The compactDisplay option works with all other number formatting options. You can control decimal places, grouping, and other formatting while choosing between short and long display.
const formatter = new Intl.NumberFormat("en-US", {
notation: "compact",
compactDisplay: "long",
maximumFractionDigits: 2
});
console.log(formatter.format(1234567));
// Output: "1.23 million"
console.log(formatter.format(9876543));
// Output: "9.88 million"
The maximumFractionDigits option controls decimal precision while compactDisplay controls the magnitude format. These options work together to produce the exact format you need.
You can combine compact display with currency formatting to show monetary amounts with spelled-out magnitudes.
const formatter = new Intl.NumberFormat("en-US", {
style: "currency",
currency: "USD",
notation: "compact",
compactDisplay: "long"
});
console.log(formatter.format(2400000));
// Output: "$2.4 million"
console.log(formatter.format(750000));
// Output: "$750 thousand"
This format works well for displaying large monetary values in financial reports or budget summaries where both the currency symbol and spelled-out magnitude provide clarity.
Compact display also works with sign display to show changes or deltas.
const formatter = new Intl.NumberFormat("en-US", {
notation: "compact",
compactDisplay: "long",
signDisplay: "always"
});
console.log(formatter.format(1500000));
// Output: "+1.5 million"
console.log(formatter.format(-850000));
// Output: "-850 thousand"
The combination of explicit signs and spelled-out magnitudes makes changes immediately clear to users.
What to remember
The compactDisplay option controls whether compact notation uses abbreviations or spelled-out words. Set it to "short" for abbreviated output like 1.5K, or "long" for spelled-out output like 1.5 thousand. The option defaults to "short" if omitted.
Use short display when space is limited or when displaying many numbers that need consistent width. Use long display when clarity and accessibility matter more than space efficiency. The formatter handles locale-specific variations automatically for both short and long formats.
Combine compactDisplay with other formatting options like decimal places, currency, and sign display to create the exact number format your application needs.