Cosmo

Locale-aware formatting for JavaScript, PHP, Python, Java & C#.

Production-ready and stable. Format money, dates, numbers, units and text the way each of your users expects — essential for any app that shows data to people. One ergonomic API, five languages, and zero bundled locale data.

Implemented in — JavaScript · PHP · Python · Java · C#

Backed by all of ICU — nothing curated away

Every value comes straight from your runtime's ICU / CLDR data. A sense of the scale you get for free:

150+ Languages English · Español · العربية · 中文 · हिन्दी · Русский
250+ Countries & regions 🇺🇸 United States · 🇩🇪 Deutschland · 🇯🇵 日本 · 🇪🇬 مصر
160+ Currencies $1,299.00 · €1.299,00 · ¥130,000 · ₹1,299.00 · ฿1,299.00
410+ Time zones New York · London · Tokyo · Kathmandu +5:45 · Chatham +12:45
18 Calendar systems Gregorian 2020 · Persian 1398 · Hebrew 5780 · Ethiopic 2012
150+ Scripts Latin · Кириллица · العربية · देवनागरी · 漢字 · ⵜⵉⴼⵉⵏⴰⵖ
75+ Numbering systems 2020 · ٢٠٢٠ · २०२० · ۲۰۲۰ · 二〇二〇
45+ Measurement units 2.19 GB · 5 km · 100 km/h · 3 L · 36.6 °C

From the everyday — US dollars, the Gregorian calendar, New York time, Latin script — to the long tail: the Persian and Ethiopic calendars, Nepal's UTC+5:45, the Adlam and Tifinagh scripts, and Eastern-Arabic numerals (٢٠٢٠).

Zero locale data

Everything comes straight from the runtime's ICU — every country, language, script, calendar and time zone. No hardcoded tables to drift out of date.

🌍

The same API everywhere

Identical method names and signatures across JavaScript, PHP, Python, Java and C#. Learn it once; read your own language across the whole site.

💱

Everything you display

Money, dates, numbers, units, percentages, plurals, lists, ranges, collation, transliteration and parsing — all in the locale's conventions.

🧩

Thin and honest

A light, ergonomic layer over ICU. If the runtime's ICU can't produce a result, the feature is omitted — never faked.