One simple way to do achieve what you want is to use String#replace() to remove the currency from the string. To make this easier, you can set currencyDisplay to "code" which will use the ISO currency code - the same one passed in to currency:

const number = 123456.789;

console.log(new Intl.NumberFormat('de-DE', { 
    style: 'currency',
    currency: 'EUR', 
    currencyDisplay: "code" 
  })
  .format(number)
  .replace("EUR", "")
  .trim()
); // 123.456,79
 
// the Japanese yen doesn't use a minor unit 
console.log(new Intl.NumberFormat('ja-JP', { 
    style: 'currency', 
   currency: 'JPY', 
    currencyDisplay: "code" 
  })
  .format(number)
  .replace("JPY", "")
  .trim()
); // 123,457

This can be extracted into a function:

const number = 123456.789;

console.log(format('de-DE', 'EUR', number)); // 123.456,79
console.log(format('ja-JP', 'JPY', number)); // 123,457

function format (locale, currency, number) {
  return new Intl.NumberFormat(locale, { 
    style: 'currency', 
    currency, 
    currencyDisplay: "code" 
  })
  .format(number)
  .replace(currency, "")
  .trim();
}


An alternative that allows you more control is to use Intl.NumberFormat#formatToParts() which formats the number but gives you tokens that you can programmatically consume and manipulate. For example, using the method with locale = "de-DE" and currency = "EUR" you get the following output:

[
  {
    "type": "integer",
    "value": "123"
  },
  {
    "type": "group",
    "value": "."
  },
  {
    "type": "integer",
    "value": "456"
  },
  {
    "type": "decimal",
    "value": ","
  },
  {
    "type": "fraction",
    "value": "79"
  },
  {
    "type": "literal",
    "value": " "
  },
  {
    "type": "currency",
    "value": "EUR"
  }
]

Which means that you can easily filter out "type": "currency" and then combine the rest into a string. For example:

const number = 123456.789;

console.log(format('de-DE', 'EUR', number)); // 123.456,79
console.log(format('ja-JP', 'JPY', number)); // 123,457

function format (locale, currency, number) {
  return new Intl.NumberFormat(locale, { 
    style: 'currency',
    currency, 
    currencyDisplay: "code",
  })
  .formatToParts(number)
  .filter(x => x.type !== "currency")
  .filter(x => x.type !== "literal" || x.value.trim().length !== 0)
  .map(x => x.value)
  .join("")
}

NOTE: the exclusion here: .filter(x => x.type !== "literal" || x.value.trim().length !== 0) handles whitespace characters within the number. That might come up when using the option currencySign: 'accounting' in the formatter. In some locales this will use parentheses for negative numbers which would leave a space inside if just the currency is removed:

const number = -123456.789;

const parts = new Intl.NumberFormat('ja-JP', { 
    style: 'currency',
    currency: 'JPY', 
    currencySign: "accounting",
    currencyDisplay: "code",
  })
  .formatToParts(number);
  
console.log(parts); 

/* output:
[
  { type: "literal" , value: "("    },
  { type: "currency", value: "JPY"  },
  { type: "literal" , value: " "    },
  { type: "integer" , value: "123"  },
  { type: "group"   , value: ","    },
  { type: "integer" , value: "457"  },
  { type: "literal" , value: ")"    }
]
*/
.as-console-wrapper { max-height: 100% !important; }

Thus negative numbers are handled correctly:

const number = -123456.789;

console.log(format('de-DE', 'EUR', number)); // 123.456,79
console.log(format('ja-JP', 'JPY', number)); // 123,457

function format (locale, currency, number) {
  return new Intl.NumberFormat(locale, { 
    style: 'currency',
    currency, 
    currencyDisplay: "code",
    currencySign: "accounting",
  })
  .formatToParts(number)
  .filter(x => x.type !== "currency")
  .filter(x => x.type !== "literal" || x.value.trim().length !== 0)
  .map(x => x.value)
  .join("")
}

Thanks to Chris Peckham for pointing out potential pitfalls when using the accounting currency sign option.

Answer from VLAZ on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat
Intl.NumberFormat - JavaScript | MDN
Getter function that formats a range of numbers according to the locale and formatting options of the Intl.NumberFormat object from which the method is called.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-intl-numberformat-constructor
JavaScript Intl.NumberFormat() Constructor - GeeksforGeeks
January 13, 2026 - The Intl.NumberFormat() constructor creates an object for formatting numbers based on locale-specific rules, making output readable and region-friendly.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat › NumberFormat
Intl.NumberFormat() constructor - JavaScript | MDN
const number = 123456.789; console.log( new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR" }).format( number, ), ); // Expected output: "123.456,79 €" // The Japanese yen doesn't use a minor unit console.log( new Intl.NumberFormat("ja-JP", { style: "currency", currency: "JPY" }).format( number, ), ); // Expected output: "¥123,457" // Limit to three significant digits console.log( new Intl.NumberFormat("en-IN", { maximumSignificantDigits: 3 }).format( number, ), ); // Expected output: "1,23,000"
🌐
DEV Community
dev.to › schalkneethling › number-and-currency-formatting-in-javascript-using-intlnumberformat-46og
Number and Currency Formatting in JavaScript using Intl.NumberFormat - DEV Community
April 3, 2024 - As with most things concerning programming, there are many ways to achieve the same end result, this is one of my favorite APIs when formatting numbers in JavaScript. NOTE: Feel free to share how you handle number formatting with JavasScript in the comments. First things first, support for Intl.NumberFormat and the related format function across runtime and browser environments is excellent so you can safely follow this post and use Intl.NumberFormat in production.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat › format
Intl.NumberFormat.prototype.format() - JavaScript | MDN
const amount = 654321.987; const options1 = { style: "currency", currency: "RUB" }; const numberFormat1 = new Intl.NumberFormat("ru-RU", options1); console.log(numberFormat1.format(amount)); // Expected output: "654 321,99 ₽" const options2 = { style: "currency", currency: "USD" }; const numberFormat2 = new Intl.NumberFormat("en-US", options2); console.log(numberFormat2.format(amount)); // Expected output: "$654,321.99"
🌐
Raymond Camden
raymondcamden.com › 2025 › 08 › 22 › unit-formatting-with-intl-in-javascript
Unit Formatting with Intl in JavaScript
I had Googled for this, and Google actually spat out a JavaScript function to do this for me. And... from what I could see... it worked well and was kinda clever. Here's the function it created: function formatBytes(bytes, locale = 'en-US') { const units = ['byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte']; const i = Math.floor(Math.log(bytes) / Math.log(1024)); const value = bytes / Math.pow(1024, i); const formatter = new Intl.NumberFormat(locale, { style: 'unit', unit: units[i], unitDisplay: 'narrow', // or 'short', 'long' maximumFractionDigits: 2, // Adjust as needed }); return formatter.format(value); }
🌐
Reality Ripple
udn.realityripple.com › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat
Intl.NumberFormat - JavaScript
Getter function that formats a number according to the locale and formatting options of this NumberFormat object. ... Returns an Array of objects representing the number string in parts that can be used for custom locale-aware formatting. ... Returns a new object with properties reflecting ...
Top answer
1 of 2
29

One simple way to do achieve what you want is to use String#replace() to remove the currency from the string. To make this easier, you can set currencyDisplay to "code" which will use the ISO currency code - the same one passed in to currency:

const number = 123456.789;

console.log(new Intl.NumberFormat('de-DE', { 
    style: 'currency',
    currency: 'EUR', 
    currencyDisplay: "code" 
  })
  .format(number)
  .replace("EUR", "")
  .trim()
); // 123.456,79
 
// the Japanese yen doesn't use a minor unit 
console.log(new Intl.NumberFormat('ja-JP', { 
    style: 'currency', 
   currency: 'JPY', 
    currencyDisplay: "code" 
  })
  .format(number)
  .replace("JPY", "")
  .trim()
); // 123,457

This can be extracted into a function:

const number = 123456.789;

console.log(format('de-DE', 'EUR', number)); // 123.456,79
console.log(format('ja-JP', 'JPY', number)); // 123,457

function format (locale, currency, number) {
  return new Intl.NumberFormat(locale, { 
    style: 'currency', 
    currency, 
    currencyDisplay: "code" 
  })
  .format(number)
  .replace(currency, "")
  .trim();
}


An alternative that allows you more control is to use Intl.NumberFormat#formatToParts() which formats the number but gives you tokens that you can programmatically consume and manipulate. For example, using the method with locale = "de-DE" and currency = "EUR" you get the following output:

[
  {
    "type": "integer",
    "value": "123"
  },
  {
    "type": "group",
    "value": "."
  },
  {
    "type": "integer",
    "value": "456"
  },
  {
    "type": "decimal",
    "value": ","
  },
  {
    "type": "fraction",
    "value": "79"
  },
  {
    "type": "literal",
    "value": " "
  },
  {
    "type": "currency",
    "value": "EUR"
  }
]

Which means that you can easily filter out "type": "currency" and then combine the rest into a string. For example:

const number = 123456.789;

console.log(format('de-DE', 'EUR', number)); // 123.456,79
console.log(format('ja-JP', 'JPY', number)); // 123,457

function format (locale, currency, number) {
  return new Intl.NumberFormat(locale, { 
    style: 'currency',
    currency, 
    currencyDisplay: "code",
  })
  .formatToParts(number)
  .filter(x => x.type !== "currency")
  .filter(x => x.type !== "literal" || x.value.trim().length !== 0)
  .map(x => x.value)
  .join("")
}

NOTE: the exclusion here: .filter(x => x.type !== "literal" || x.value.trim().length !== 0) handles whitespace characters within the number. That might come up when using the option currencySign: 'accounting' in the formatter. In some locales this will use parentheses for negative numbers which would leave a space inside if just the currency is removed:

const number = -123456.789;

const parts = new Intl.NumberFormat('ja-JP', { 
    style: 'currency',
    currency: 'JPY', 
    currencySign: "accounting",
    currencyDisplay: "code",
  })
  .formatToParts(number);
  
console.log(parts); 

/* output:
[
  { type: "literal" , value: "("    },
  { type: "currency", value: "JPY"  },
  { type: "literal" , value: " "    },
  { type: "integer" , value: "123"  },
  { type: "group"   , value: ","    },
  { type: "integer" , value: "457"  },
  { type: "literal" , value: ")"    }
]
*/
.as-console-wrapper { max-height: 100% !important; }

Thus negative numbers are handled correctly:

const number = -123456.789;

console.log(format('de-DE', 'EUR', number)); // 123.456,79
console.log(format('ja-JP', 'JPY', number)); // 123,457

function format (locale, currency, number) {
  return new Intl.NumberFormat(locale, { 
    style: 'currency',
    currency, 
    currencyDisplay: "code",
    currencySign: "accounting",
  })
  .formatToParts(number)
  .filter(x => x.type !== "currency")
  .filter(x => x.type !== "literal" || x.value.trim().length !== 0)
  .map(x => x.value)
  .join("")
}

Thanks to Chris Peckham for pointing out potential pitfalls when using the accounting currency sign option.

2 of 2
5

If you only want the separators in between individual digits, just format as a number instead of using currency:

const numberFormatter = new Intl.NumberFormat("en-US", {
  // Do not show fractions - front end should only handle whole numbers
  maximumFractionDigits: 0,
});

And then numberFormatter.format(asNumber); with whatever number you like.

For your example of 123456, "de-DE" is 123.456, "ja-JP" is 123,456

Find elsewhere
🌐
MDN
mdn2.netlify.app › en-us › docs › web › javascript › reference › global_objects › intl › numberformat › numberformat
Intl.NumberFormat() constructor - JavaScript | MDN
const nf = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", maximumFractionDigits: 2, roundingIncrement: 5 }); console.log(nf.format(11.29)); // > output: "$11.30" console.log(nf.format(11.25)); // > output: "$11.25" console.log(nf.format(11.22)); // > output: "$11.20"
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat › formatRange
Intl.NumberFormat.prototype.formatRange() - JavaScript | MDN
const nf = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", maximumFractionDigits: 0, }); console.log(nf.formatRange(3, 5)); // "$3 – $5" // Note: the "approximately equals" symbol is added if // startRange and endRange round to the same values.
🌐
DEV Community
dev.to › orimdominic › formatting-numbers-in-javascript-with-intl-numberformat-5goo
Formatting Numbers in JavaScript with Intl.NumberFormat - DEV Community
August 24, 2024 - It simply means that with Intl.NumberFormat, JavaScript can construct an object that will have the ability to style (or to be technically correct, format) numbers based on human languages.
🌐
Unibo
lia.disi.unibo.it › materiale › JS › developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › NumberFormat.html
Intl.NumberFormat - JavaScript | MDN
NumberFormat instances inherit the following methods from their prototype: ... Returns a new object with properties reflecting the locale and collation options computed during initialization of the object.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat › formatToParts
Intl.NumberFormat.prototype.formatToParts() - JavaScript | MDN
const number = 3500; const formatter = new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR", }); formatter.format(number); // "3.500,00 €"
🌐
Reality Ripple
udn.realityripple.com › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat › NumberFormat
Intl.NumberFormat() constructor - JavaScript
let amount = 3500; new Intl.NumberFormat('en-US', {style: 'unit', unit: 'liter'}).format(amount); // → '3,500 L' new Intl.NumberFormat('en-US', {style: 'unit', unit: 'liter', unitDisplay: 'long'}).format(amount); // → '3,500 liters'
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat › formatRangeToParts
Intl.NumberFormat.prototype.formatRangeToParts() - JavaScript | MDN
const startRange = 3500; const endRange = 9500; const formatter = new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR", }); console.log(formatter.formatRange(startRange, endRange)); // "3.500,00–9.500,00 €"
🌐
Format.JS
formatjs.github.io › docs › polyfills › intl-numberformat
Intl Numberformat | FormatJS
import '@formatjs/intl-numberformat/polyfill.js' // Currency with accounting sign const currency = new Intl.NumberFormat('en', { style: 'currency', currency: 'USD', currencySign: 'accounting', }) currency.format(-100) // "($100.00)" // Unit formatting const unit = new Intl.NumberFormat('en', { style: 'unit', unit: 'kilometer-per-hour', unitDisplay: 'long', }) unit.format(100) // "100 kilometers per hour" // Rounding with increment const rounded = new Intl.NumberFormat('en', { style: 'currency', currency: 'USD', roundingIncrement: 5, minimumFractionDigits: 2, maximumFractionDigits: 2, }) rounded.format(10.03) // "$10.05" (rounded to nearest 0.05) // Format range const range = new Intl.NumberFormat('en', {style: 'percent'}) range.formatRange(20, 30) // "20%–30%"
🌐
Codú
codu.co › home › feed › niall maher › formatting money in javascript with intl.numberformat
Formatting Money in JavaScript with Intl.NumberFormat | by Niall Maher | Codú
April 11, 2024 - console.log( new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", }).format(1234.56), ); // Outputs: "$1,234.56" // Or if you want to make it reusable: const usFormatter = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', }); console.log(usFormatter.format(1234.56)); // Outputs: "$1,234.56"
🌐
JavaScript in Plain English
javascript.plainenglish.io › intl-numberformat-api-a-comprehensive-guide-f310a760733b
Intl.NumberFormat API: A Comprehensive Guide | by Danielle Dias | JavaScript in Plain English
June 13, 2023 - Follow to join our 3.5M+ monthly readers. ... In this article, we will explore the various functionalities and features provided by the Intl.NumberFormat API, which is a part of the Internationalization API in JavaScript.