You need to use the narrow option when formatting numbers in JS

"narrowSymbol" to use a narrow format symbol ("$100" rather than "US$100"),

const amount = 123444;
console.log(new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', currencyDisplay: 'narrowSymbol'}).format(amount));

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat for full details.

Answer from John on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat › NumberFormat
Intl.NumberFormat() constructor - JavaScript | MDN
const 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' If the style is 'currency', a currency property must be provided. Optionally, currencyDisplay and currencySign control the unit formatting.
🌐
Go Make Things
gomakethings.com › how-to-format-a-number-as-currency-with-the-intl.numberformat-api-in-vanilla-javascript
How to format a number as currency with the Intl.NumberFormat API in vanilla JavaScript | Go Make Things
The options object for the new Intl.NumberFormat() surfaces a few additional properties we can use to customize the formatting of our currency string. The currencyDisplay property controls how the currency symbol is formatted.
🌐
TC39
tc39.es › proposal-intl-currency-display-choices
More Currency Display Choices
The abstract operation SetNumberFormatUnitOptions takes arguments intlObj (an Intl.NumberFormat) and options (an Object) and returns either a ... throw completion. It resolves the user-specified options relating to units onto intlObj. It performs the following steps when called: ... Set intlObj.[[Style]] to style. ... TypeError exception. ... RangeError exception. ... TypeError exception. ... RangeError exception. ... ASCII-uppercase of currency. Set intlObj.[[CurrencyDisplay]] to currencyDisplay.
🌐
Intl Explorer
intl-explorer.com › NumberFormat › Currency
Intl.NumberFormat Currency
Intl.NumberFormat can also be used from Number.prototype.toLocaleString() const number = 123456.789 number.toLocaleString(undefined) // €123,456.79 · { currencySign: "standard", style: "currency", currency: "EUR" } // €123,456.79 · Copy Code · { currencySign: "accounting", style: "currency", currency: "EUR" } // €123,456.79 · Copy Code · { currencyDisplay: "code", style: "currency", currency: "EUR" } // EUR 123,456.79 ·
🌐
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 - One critical aspect of ... JavaScript’s Intl.NumberFormat object is a powerful tool that helps you format numbers, including currencies, for any locale....
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 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.
🌐
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 - Let’s take a look at an example that demonstrates the usage of the currencyDisplay option: const formatter = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', currencyDisplay: 'code', }); const formattedNumber = formatter.format(1234.56); console.log(formattedNumber); // Output: "USD 1,234.56" In this example, the currency code is displayed before the formatted number, resulting in the string "USD 1,234.56".
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat › formatToParts
Intl.NumberFormat.prototype.formatToParts() - JavaScript | MDN
The form ("code", "symbol", "narrowSymbol", or "name") can be controlled via options.currencyDisplay. unknown · 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: js · const number = 3500; const formatter = new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR", }); formatter.format(number); // "3.500,00 €" However, in many user interfaces you may want to customize the formatting of this string, or interleave it with other texts.
🌐
TC39
tc39.es › proposal-intl-numberformat-v3 › out › numberformat › proposed.html
1.1 The Intl.NumberFormat Constructor
Let cd be an ILD String value representing currency after x in currencyDisplay form, which may depend on x in languages having different plural forms. If the implementation does not have such a representation of currency, use currency itself. ... Let unknown be an ILND String based on x and p. ... Return result. The PartitionNotationSubPattern abstract operation is called with arguments numberFormat (which must be an object initialized as a NumberFormat), x (which is an · Intl mathematical value after rounding is applied), n (which is an intermediate formatted string), and exponent (an integer), and creates the corresponding parts for the number and notation according to the effective locale and the formatting options of numberFormat.
🌐
SamanthaMing
samanthaming.com › tidbits › 30-how-to-format-currency-in-es6
How to Format Currency in ES6 | SamanthaMing.com
const money = 10000; new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR', }).format(money); // '€ 10,000.00' new Intl.NumberFormat('jp-JP', { style: 'currency', currency: 'JPY', }).format(money); // 'JP¥ 10,000' new Intl.NumberFormat('zh-CN', { style: 'currency', currency: 'CNY', }).format(money); // 'CN¥ 10,000.00'
🌐
Career Karma
careerkarma.com › blog › javascript › javascript format currency (intl.numberformat)
JavaScript Format Currency (intl.numberformat) | Career Karma
November 10, 2020 - CurrencyDisplay will display the currency in different formatting using values such as symbol, narrowSymbol, code, and name. let money = 85000.50; const symbol = new Intl.NumberFormat('en-USD', { style: 'currency', currency: 'USD', currencyDisplay: ...
🌐
MDN
mdn2.netlify.app › en-us › docs › web › javascript › reference › global_objects › intl › numberformat › numberformat
Intl.NumberFormat() constructor - JavaScript | MDN
let amount = -3500; new Intl.NumberFormat('en-US', {style: 'currency', currency: 'USD'}).format(amount); // → '-$3,500.00' new Intl.NumberFormat('bn', { style: 'currency', currency: 'USD', currencyDisplay: 'name' }).format(amount); // → '-3,500.00 US dollars' new Intl.NumberFormat('bn', { style: 'currency', currency: 'USD', currencySign: 'accounting' }).format(amount); // → '($3,500.00)' Scientific and compact notation are represented by the notation option and can be formatted like this: new Intl.NumberFormat('en-US', { notation: "scientific" }).format(987654321); // → 9.877E8 new Int
🌐
GitHub
github.com › facebook › hermes › issues › 914
Intl.NumberFormat currencyDisplay 'name' does not respect currency · Issue #914 · facebook/hermes
October 2, 2022 - Without currencyDisplay, currency is correctly taken into account. Hermes version: React Native version (if any): 0.70.6 & 0.71.3 OS version (if any): iOS 15.4 Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): arm64-v8a · Run the below code sample on iOS. new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'USD', currencyDisplay: 'name', }).format(2) // expected: "2,00 US-Dollar" // actual: "2,00 Euro" - wrong new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'USD' }).format(2) // expected: "2,00 $" // actual: "2,00 $" - correct
Author   asherLZR
🌐
GitHub
github.com › tc39 › proposal-intl-currency-display-choices
GitHub - tc39/proposal-intl-currency-display-choices · GitHub
The proposed solution is to add the following two currencyDisplay option values: formalSymbol — A wider format symbol or the ISO currency code ("US$100" rather than "$100"). An alternative spelling for this could be wideSymbol. never — Do not display any currency symbol or name. const formal = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", currencyDisplay: "formalSymbol", }); formal.format(42); // "US$42.00" const never = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", currencyDisplay: "never", }); never.format(42); // "42.00"
Author   tc39
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-intl-numberformat-constructor
JavaScript Intl.NumberFormat() Constructor - GeeksforGeeks
January 13, 2026 - Options: It is an object which can have properties like compactDisplay, currency,currencyDisplay, currencySign ,style, unit,unitDisplay, etc. Return value: It return a new Intl.NumberFormat object.