Novis\Intl\NumberFormat
Writes numbers the way a language and region write them. Each method takes a whole list and a locale tag, such as "de" or "en-IN", and formats the whole list in one call.
Members
4 members.
| Member | Signature |
|---|---|
decimal | decimal(array<int|float|decimal> $numbers, string $locale, ?DigitOptions $options = null): array<string> |
percent | percent(array<int|float|decimal> $numbers, string $locale, ?DigitOptions $options = null): array<string> |
currency | currency(array<int|float|decimal> $amounts, string $currency, string $locale, ?{ display?: CurrencyDisplay } $options = null): array<string> |
compact | compact(array<int|float|decimal> $numbers, string $locale, ?{ display?: CompactDisplay } $options = null): array<string> |
Enums
CurrencyDisplay { Symbol, Narrow, Name }HowNumberFormat::currencywrites the currency of an amount.Symbolwrites the usual symbol of the language and region. This is the default. In Canada, "$" means Canadian dollars. So in English for Canada, 19.90 US dollars are written "US$19.90".Narrowwrites the shortest symbol, such as "$19.90". A reader may not know which dollar it is.Namewrites the name of the currency, such as "19.90 US dollars".CompactDisplay { Short, Long }How a compact number is written. A compact number is a large number written short, such as "1.2K" for 1,200.Shortwrites "1.2K" and is the default.Longwrites "1.2 thousand".
