Skip to content

Introduction

Cosmo formats money, dates, numbers, units, and text using the conventions of a locale. Set a locale and, for date and time formatting, a time zone, then call the formatter you need.

Cosmo uses ICU for locale data and formatting:

using Miloun.Cosmo;

var c = new Cosmo("es-ES");
c.Money(11000.4, "EUR");     // "11.000,40 €"
c.Percentage(0.2);           // "20%"

Locale data from ICU

Cosmo reads locale data from ICU rather than maintaining its own tables. The library calls ICU4C through P/Invoke and bundles ICU 72 native binaries.

See Platform notes for supported features and limitations.

Next steps