JavaScript Intl.NumberFormat() Constructor Last Updated : 06 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The Javascript Intl.NumberFormat() constructor is used to create Intl.NumberFormat() object that enables language-sensitive number formatting. This constructor is created with or without a new keyword both create a new Intl.NumberFormat instance. Syntax: new Intl.NumberFormat() new Intl.NumberFormat([locales[, options]]) Parameters: Locales: It contains a String or an array of Strings that allow the following value.num: It specifies the numbering system to be used which can be arab, bali, latn, tibt etc.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. Example 1: In this example, we will use the basic use of Intl.NumberFormat() constructor. JavaScript let amount = 10000; let newAmount = new Intl.NumberFormat().format(amount) console.log(newAmount); Output: 10,000 Example 2: In this example, we will perform Decimal and percentage formatting with the help of Intl.NumberFormat() constructor. JavaScript let amount = 2000; let newAmount1 = new Intl.NumberFormat('en-US', { style: 'decimal' }).format(amount); let newAmount2 = new Intl.NumberFormat('en-US', { style: 'percent' }).format(amount); console.log(newAmount1); console.log(newAmount2); Output: 2,000 200,000% Example 3: In this example, we will perform unit formatting and currency formatting with the help of Intl.NumberFormat() constructor. JavaScript let num = 5000; // Unit formatting let num1 = new Intl.NumberFormat('en-US', { style: 'unit', unit: 'liter' }).format(num); let num2 = new Intl.NumberFormat('en-US', { style: 'unit', unit: 'liter', unitDisplay: 'long' }).format(num); // Currancy formatting let currancy = 50; let newCurrancy = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(currancy); console.log(num1); console.log(num2); console.log(newCurrancy); Output: 5,000 L 5,000 liters $50.00 Supported Browsers: Chrome 24Edge 12Firefox 29Opera 15Safari 10 We have a complete list of JavaScript Intl methods to check please go through, the JavaScript Intl Reference article. Comment More infoAdvertise with us Next Article JavaScript Intl.NumberFormat() Constructor V vishalkumar2204 Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Methods JavaScript-Intl Similar Reads JavaScript Intl ListFormat() Constructor JavaScript Intl.ListFormat() Constructor is used for creating Intl.ListFormat object. This constructor is created using the new keyword. If we create the constructor without the new keyword it will give a TypeError. Syntax: new Intl.ListFormat(loc, opt) Parameters: It has two parameters both are opt 2 min read JavaScript Intl DateTimeFormat() Constructor JavaScript Intl.DateTimeFormat Constructor is used for creating Intl.DateTimeFormat objects. This constructor can be called with or without the new keyword Syntax: Intl.DateTimeFormat(loc, opt) new Intl.DateTimeFormat(loc, opt) Parameter: This constructor has two methods and both are optional. loc: 2 min read NumberFormat Class in Java NumberFormat is an abstract base class for all number formats. This class provides the interface for formatting and parsing numbers. NumberFormat also provides methods for determining which locales (US, India, Italy, etc.) have number formats and their names. NumberFormat helps you to format and par 2 min read NumberFormat getCompactNumberInstance() Method in Java with Examples NumberFormat is the abstract base class for all number formats. This class provides the interface for formatting and parsing numbers. NumberFormat class also provides methods for determining which locales(US, Italy, etc) have number formats, and their names NumberFormat helps you to format and parse 4 min read Java.lang.Integer class in Java Integer class is a wrapper class for the primitive type int which contains several methods to effectively deal with an int value like converting it to a string representation, and vice-versa. An object of the Integer class can hold a single int value. Constructors: Integer(int b): Creates an Integer 15 min read NumberFormat getIntegerInstance() method in Java with Examples The getIntegerInstance() method is a built-in method of the java.text.NumberFormat returns an integer number format for the current default FORMAT locale. Syntax: public static final NumberFormat getIntegerInstance() Parameters: The function does not accepts any parameter. Return Value: The function 2 min read Integer intValue() Method in Java intValue() of Integer class that is present inside java.lang package is an inbuilt method in java that returns the value of this integer as an int which is inherited from Number Class. The package view is as follows: --> java.lang Package --> Integer Class --> intValue() Method Syntax: publ 3 min read Java.lang.Number Class in Java Most of the time, while working with numbers in java, we use primitive data types. But, Java also provides various numeric wrapper sub classes under the abstract class Number present in java.lang package. There are mainly six sub-classes under Number class.These sub-classes define some useful method 9 min read NumberFormat getNumberInstance() method in Java with Examples The getNumberInstance() method is a built-in method of the java.text.NumberFormat returns an general purpose number format for the current default FORMAT locale. Syntax: public static final NumberFormat getNumberInstance() Parameters: The function does not accepts any parameter. Return Value: The fu 2 min read Like