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
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

🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat › NumberFormat
Intl.NumberFormat() constructor - JavaScript - MDN Web Docs
January 25, 2026 - Thrown if the options.style property is set to "unit" or "currency", and no value has been set for the corresponding property options.unit or options.currency. In basic use without specifying a locale, a formatted string in the default locale and with default options is returned. ... const amount = 3500; console.log(new Intl.NumberFormat().format(amount)); // '3,500' if in US English locale
🌐
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 - This is not ideal for several reasons. Our decimal value is hard coded as is our currency symbol. It is also hard to read and error-prone. In addition, the hard-coded decimal value is especially problematic. One of the many things NumberFormat can help us with is with currencies.
Top answer
1 of 15
29

There is no way to pass parameter to toLocaleString and remove currency symbol. so use this function instead.

var convertedNumber = num.toLocaleString('de-DE', { minimumFractionDigits: 2 });

2 of 15
18

Here how I solved this issue. When I want to format currency without any signs, I format it with the currency code and then just remove 3-chars code from the result.

export function getCurrencyFormatWithSymbol(currencyCode) {
  return {
    style: 'currency',
    currency: currencyCode,
    currencyDisplay: 'symbol',
  }
}

export function getCurrencyFormatWithIsoCode(currencyCode) {
  return {
    style: 'currency',
    currency: currencyCode,
    currencyDisplay: 'code',
  }
}

export function getCurrencyFormatWithLocalName(currencyCode) {
  return {
    style: 'currency',
    currency: currencyCode,
    currencyDisplay: 'name',
  }
}

export function getCurrencyFormatNumbersOnly(currencyCode) {
  return {
    style: 'currency',
    currency: currencyCode,
    currencyDisplay: 'none',
  }
}

export function formatCurrency (value, format, lang) {
  const stripSymbols = (format.currencyDisplay === 'none')
  const localFormat = stripSymbols ? {...format, currencyDisplay: 'code'} : format
  let result = Intl.NumberFormat(lang, localFormat).format(value)
  if (stripSymbols) {
    result = result.replace(/[a-z]{3}/i, "").trim()
  }
  return result
}

Usage:

const format = getCurrencyFormatNumbersOnly('JPY')
formatCurrency(12345, format, 'ja')
formatCurrency(123456, format, 'ja')
formatCurrency(1234567, format, 'ja')
formatCurrency(12345678, format, 'ja')

Edit: The only minus, in this case, is the speed. On simple tasks, it will work perfectly. But if you are going to format a lot of numbers (for example, if you are fetching financial reports with raw data from backend and then format numbers according to user settings) this function can slow down your algorithms significantly and become a bottleneck on some browsers. So, test it carefully before using in production.

🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat
Intl.NumberFormat - JavaScript - MDN Web Docs
In basic use without specifying a locale, a formatted string in the default locale and with default options is returned. ... const number = 3500; console.log(new Intl.NumberFormat().format(number)); // '3,500' if in US English locale
🌐
freeCodeCamp
freecodecamp.org › news › how-to-format-number-as-currency-in-javascript-one-line-of-code
How to Format a Number as Currency in JavaScript
November 7, 2024 - When you use the Intl.NumberFormat() constructor without passing any locale or option, it will only format the number by adding commas. const price = 14340; console.log(new Intl.NumberFormat().format(price)); // 14,340 · You are not after regular ...
Find elsewhere
🌐
codestudy
codestudy.net › blog › currency-formatting-using-intl-numberformat-without-currency-symbol
How to Format Currency Without Symbols Using Intl.NumberFormat in JavaScript — codestudy.net
In this guide, we’ll explore how to use Intl.NumberFormat to format currency values without symbols, along with advanced customization options like decimal precision, thousand separators, and locale-specific formatting.
🌐
GitHub
github.com › microsoft › ChakraCore › issues › 2778
Intl.NumberFormat currency symbols are inaccurate when dealing with different types of dollars/$. · Issue #2778 · chakra-core/ChakraCore
April 4, 2017 - I think this is a bug... The following code in Chrome, Firefox, etc, will return a currency symbol of 'US$': new Intl.NumberFormat('en-CA', { style: 'currency', currencyDisplay: 'symbol', currency: 'USD' }).format(65421.45) And it will s...
Author   kirstenwallace
🌐
egghead.io
egghead.io › lessons › javascript-format-numbers-as-currencies-using-javascript-intl-api
Format Numbers as Currencies Using Javascript Intl API | egghead.io
Javascript offers a way to handle this simply by just defining the language (locale) and the currency symbol you want to use. This API is Intl.NumberFormat
Published   September 23, 2022
🌐
W3C
w3c.github.io › i18n-drafts › questions › qa-number-format.en.html
Number, currency, and unit formatting
1 week ago - Ambiguity: The same symbol might represent multiple currencies (e.g., $ for US Dollar, Canadian Dollar, Mexican Peso, etc.). The Intl.NumberFormat object in JavaScript automatically handles locale-specific decimal and grouping separators, currency symbols, and other numerical conventions.
🌐
Pub.dev
pub.dev › documentation › intl › latest › intl › NumberFormat-class.html
NumberFormat class - intl library - Dart API
Creates a NumberFormat for currencies, using the simple symbol for the currency if one is available (e.g.
🌐
SamanthaMing
samanthaming.com › tidbits › 30-how-to-format-currency-in-es6
How to Format Currency in ES6 | SamanthaMing.com
You can now use the NumberFormat instance to format any number into a currency value. const money = 💰; // Old Way money.toLocaleString('en-US', {style: 'currency', currency: 'USD'} ); // '$100.00' // ✅ ES6 Way new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' } ).format(money); // '$100.00' More Currency Conversion ·
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat › formatToParts
Intl.NumberFormat.prototype.formatToParts() - JavaScript | MDN
August 10, 2024 - The form ("code", "symbol", "narrowSymbol", or "name") can be controlled via options.currencyDisplay. ... Reserved for any token that's not recognized as one of the above; should be rarely encountered. The format() method outputs localized, opaque strings that cannot be manipulated directly: ... const number = 3500; const formatter = new Intl.NumberFormat...
🌐
Intl Explorer
intl-explorer.com › NumberFormat › Currency
Intl.NumberFormat Currency
Intl Explorer is an interactive tool for experimenting and trying out the ECMAScript Internationalization API.
🌐
Medium
medium.com › @Marioskif › javascript-daily-tips-73-how-to-use-javascripts-intl-numberformat-for-currency-formatting-b8360ac993b5
JavaScript Daily Tips #73: How to Use JavaScript’s Intl.NumberFormat for Currency Formatting | by Mariosdev | Medium
December 13, 2024 - Intl.NumberFormat is part of the ECMAScript Internationalization API. It provides an easy way to format numbers based on the rules of a specific locale. This includes number separators, decimals, and, importantly for this article, currency formatting.