If you target to modern browsers you can use:

new Intl.NumberFormat('en-us', {minimumFractionDigits: 2}).format(1234567.89)

or

(1234567.89).toLocaleString('en-us', {minimumFractionDigits: 2})

For browser support: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat

Answer from HolgerJeromin on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › NumberFormat
Intl.NumberFormat - JavaScript - MDN Web Docs
In order to get the format of the language used in the user interface of your application, make sure to specify that language (and possibly some fallback languages) using the locales argument: ... const number = 123456.789; // German uses comma as decimal separator and period for thousands console.log(new Intl.NumberFormat("de-DE").format(number)); // 123.456,789 // Arabic in most Arabic speaking countries uses real Arabic digits console.log(new Intl.NumberFormat("ar-EG").format(number)); // ١٢٣٤٥٦٫٧٨٩ // India uses thousands/lakh/crore separators console.log(new Intl.NumberFormat("en-IN").format(number)); // 1,23,456.789 // the nu extension key requests a numbering system, e.g.
🌐
Tutorial Teacher
tutorialsteacher.com › typescript › typescript-number
TypeScript Data Type - Number
This function takes in one argument, an optional integer specifying the number of digits after the decimal point. It returns the exponential representation of the number in a string format.
🌐
TutorialsPoint
tutorialspoint.com › typescript › typescript_number_tofixed.htm
TypeScript - Number toFixed()
This method formats a number with a specific number of digits to the right of the decimal. digits − The number of digits to appear after the decimal point. A string representation of number that does not use exponential notation and has the exact
🌐
Angular
angular.dev › api › common › formatNumber
formatNumber • Angular
Formats a number as text, with group sizing, separator, and other parameters based on the locale.
🌐
Joshuaslate
joshuaslate.com › blog › currency-values-in-typescript
Working with Currency Values in TypeScript
November 28, 2022 - The cornerstone of our currency formatting will be Intl.NumberFormat.
🌐
Medium
medium.com › @padamghimire › creating-a-currency-formatter-in-typescript-c45c6cf199d7
Creating a Currency Formatter in TypeScript | by Padam Ghimire | Medium
March 11, 2024 - Options Object: The Intl.NumberFormat constructor takes an options object as its second argument. In our case, we specify the following options: style: This specifies the formatting style.
🌐
Educative
educative.io › answers › what-is-the-numbertoprecision-method-in-typescript
What is the Number.toPrecision() method in TypeScript?
We can use the Number.toPrecision() method in TypeScript to format a number to a specified length. With this method, we can even add a decimal point or nulls to create the specified length.
Find elsewhere
🌐
GitHub
gist.github.com › joaohcrangel › 47810bc4ff2d78ce9f9cf908a43d6e9b
Format number to currency in TypeScript · GitHub
Format number to currency in TypeScript. GitHub Gist: instantly share code, notes, and snippets.
🌐
Medium
salathiel-ojage.medium.com › how-to-format-us-phone-numbers-with-typescript-while-the-user-types-in-4f5c07aa84cf
How to format US phone numbers with Typescript, while the user types in | by Ojage Salathiel | Medium
May 12, 2024 - A typical US phone number format is +1(XXX) XXX-XXXX, where X represents a digit. The objective is to convert a string of numbers, like 1234567890, into this readable format. The following typescript function takes in the phone number as valueand ...
🌐
GeeksforGeeks
geeksforgeeks.org › typescript › typescript-tofixed-function
TypeScript toFixed() Function - GeeksforGeeks
July 19, 2024 - The toFixed() function in TypeScript formats a number using fixed-point notation, specifying the number of digits after the decimal point.
🌐
SPGuides
spguides.com › typescript-number-format-2-digits
How to Format Numbers as Two Digits in TypeScript
July 22, 2025 - Check out Get String Between 2 Characters In TypeScript · For projects that may need to scale internationally or require more advanced formatting, I recommend Intl.NumberFormat.
🌐
Angular
v17.angular.io › api › common › formatNumber
formatNumber
Angular is a platform for building mobile and desktop web applications. Join the community of millions of developers who build compelling user interfaces with Angular.
🌐
Educative
educative.io › answers › what-are-numbers-in-typescript
What are numbers in TypeScript?
It doesn’t have different data types, like int, float, or double. Everything is simply a number in TypeScript.
🌐
typescriptlang.org
typescriptlang.org › docs › handbook › 2 › everyday-types.html
TypeScript: Documentation - Everyday Types
We’ll start by reviewing the most basic and common types you might encounter when writing JavaScript or TypeScript code. These will later form the core building blocks of more complex types. JavaScript has three very commonly used primitives: string, number, and boolean.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › typescript tutorial › typescript number to string
TypeScript number to string | Learn the Examples and Primitive Types
April 5, 2023 - In typescript, Number to string is a method of conversion which is defined as converting the given number to string using the method provided number data type, which supports floating-point numbers such as decimal or hexadecimal or octal numbers.
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
Tutlane
tutlane.com › tutorial › typescript › typescript-number-data-type
TypeScript Number Data Type - Tutlane
The TypeScript will support all numeric values same as JavaScript and it will store all the numbers as floating-point numbers.