Hard-coding how dates, numbers and money look is a bug waiting to happen. In India a lakh is written 1,00,000; in the US it is 100,000. Dates flip between day-first and month-first. The Intl API formats all of it correctly for any language and region, using the same data browsers already ship with.
Intl.NumberFormat handles numbers and currencies. Pass a locale like en-IN and the grouping, decimal separator and currency symbol all follow that locale's rules.
const inr = new Intl.NumberFormat("en-IN", { style: "currency", currency: "INR" }); console.log(inr.format(100000)); // "₹1,00,000.00" const usd = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }); console.log(usd.format(100000)); // "$100,000.00" Intl.DateTimeFormat does the same for dates. One formatter, many locales — no manual string building, no month-name arrays.
const date = new Date(2026, 11, 6); console.log(new Intl.DateTimeFormat("en-IN", { dateStyle: "full" }).format(date)); // "Sunday, 6 December 2026" console.log(new Intl.DateTimeFormat("hi-IN", { dateStyle: "long" }).format(date)); // "6 दिसंबर 2026" Intl also covers the cases beginners usually hand-roll badly. Intl.RelativeTimeFormat turns "3 days ago" into any language, and Intl.ListFormat joins lists with the right separators and conjunctions.
const relative = new Intl.RelativeTimeFormat("en", { numeric: "auto" }); console.log(relative.format(-3, "day")); // "3 days ago" const list = new Intl.ListFormat("en", { style: "long", type: "conjunction" }); console.log(list.format(["HTML", "CSS", "JavaScript"])); // "HTML, CSS, and JavaScript" Two habits will serve you well: create your formatters once and reuse them — they are expensive to construct — and always pass an explicit locale instead of relying on the user's default, so your output is predictable in tests.
The Intl API replaces dozens of lines of manual formatting with one-liners that work in every language. Learn NumberFormat and DateTimeFormat first, and your app will look right to users everywhere, not just in your own country.

