analytics/Plausible.Cldr.Number.Format.html
2023-08-17 13:04:12 +00:00

869 lines
60 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.30.3">
<meta name="project" content="Plausible v0.0.1">
<title>Plausible.Cldr.Number.Format — Plausible v0.0.1</title>
<link rel="stylesheet" href="dist/html-elixir-P5GXSCHE.css" />
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
<script src="dist/handlebars.templates-NBND3S2D.js"></script>
<script src="dist/sidebar_items-76FA772C.js"></script>
<script src="docs_config.js"></script>
<script async src="dist/html-CGDDOCMI.js"></script>
</head>
<body data-type="modules" class="page-module">
<script>
try {
var settings = JSON.parse(localStorage.getItem('ex_doc:settings') || '{}');
if (settings.theme === 'dark' ||
((settings.theme === 'system' || settings.theme == null) &&
window.matchMedia('(prefers-color-scheme: dark)').matches)
) {
document.body.classList.add('dark')
}
} catch (error) { }
</script>
<div class="main">
<button class="sidebar-button sidebar-toggle" aria-label="toggle sidebar">
<i class="ri-menu-line ri-lg" title="Collapse/expand sidebar"></i>
</button>
<section class="sidebar">
<form class="sidebar-search" action="search.html">
<button type="submit" class="search-button" aria-label="Submit Search">
<i class="ri-search-2-line" aria-hidden="true" title="Submit search"></i>
</button>
<button type="button" tabindex="-1" class="search-close-button" aria-label="Cancel Search">
<i class="ri-close-line ri-lg" aria-hidden="true" title="Cancel search"></i>
</button>
<label class="search-label">
<p class="sr-only">Search</p>
<input name="q" type="text" class="search-input" placeholder="Search..." aria-label="Input your search terms" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
</label>
</form>
<div class="autocomplete">
<div class="autocomplete-results">
</div>
</div>
<div class="sidebar-header">
<a href="readme.html">
<img src="assets/logo.png" alt="Plausible" class="sidebar-projectImage">
</a>
<div class="sidebar-projectDetails">
<a href="readme.html" class="sidebar-projectName" translate="no">
Plausible
</a>
<div class="sidebar-projectVersion" translate="no">
v0.0.1
</div>
</div>
<ul class="sidebar-listNav">
<li><a id="extras-list-link" href="#full-list">Pages</a></li>
<li><a id="modules-list-link" href="#full-list">Modules</a></li>
<li><a id="tasks-list-link" href="#full-list"><span translate="no">Mix</span> Tasks</a></li>
</ul>
</div>
<div class="gradient"></div>
<ul id="full-list"></ul>
</section>
<section class="content">
<output role="status" id="toast"></output>
<div class="content-outer">
<div id="content" class="content-inner">
<h1>
<button class="icon-action display-settings">
<i class="ri-settings-3-line"></i>
<span class="sr-only">Settings</span>
</button>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/cldr.ex#L1" title="View Source" class="icon-action" rel="help">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
<span translate="no">Plausible.Cldr.Number.Format</span>
<small class="app-vsn" translate="no">(Plausible v0.0.1)</small>
</h1>
<section id="moduledoc">
<p>Functions to manage the collection of number patterns defined in Cldr.</p><p>Number patterns affect how numbers are interpreted in a localized context.
Here are some examples, based on the French locale. The &quot;.&quot; shows where the
decimal point should go. The &quot;,&quot; shows where the thousands separator should
go. A &quot;0&quot; indicates zero-padding: if the number is too short, a zero (in the
locale's numeric set) will go there. A &quot;#&quot; indicates no padding: if the
number is too short, nothing goes there. A &quot;¤&quot; shows where the currency sign
will go. The following illustrates the effects of different patterns for the
French locale, with the number &quot;1234.567&quot;. Notice how the pattern characters
',' and '.' are replaced by the characters appropriate for the locale.</p><h2 id="module-number-pattern-examples" class="section-heading">
<a href="#module-number-pattern-examples">
<i class="ri-link-m" aria-hidden="true"></i>
Number Pattern Examples
</a>
</h2>
<table><thead><tr><th style="text-align: left;">Pattern</th><th style="text-align: center;">Currency</th><th style="text-align: right;">Text</th></tr></thead><tbody><tr><td style="text-align: left;">#,##0.##</td><td style="text-align: center;">n/a</td><td style="text-align: right;">1 234,57</td></tr><tr><td style="text-align: left;">#,##0.###</td><td style="text-align: center;">n/a</td><td style="text-align: right;">1 234,567</td></tr><tr><td style="text-align: left;">###0.#####</td><td style="text-align: center;">n/a</td><td style="text-align: right;">1234,567</td></tr><tr><td style="text-align: left;">###0.0000#</td><td style="text-align: center;">n/a</td><td style="text-align: right;">1234,5670</td></tr><tr><td style="text-align: left;">00000.0000</td><td style="text-align: center;">n/a</td><td style="text-align: right;">01234,5670</td></tr><tr><td style="text-align: left;">#,##0.00 ¤</td><td style="text-align: center;">EUR</td><td style="text-align: right;">1 234,57 €</td></tr></tbody></table><p>The number of # placeholder characters before the decimal do not matter,
since no limit is placed on the maximum number of digits. There should,
however, be at least one zero some place in the pattern. In currency formats,
the number of digits after the decimal also do not matter, since the
information in the supplemental data (see Supplemental Currency Data) is used
to override the number of decimal places — and the rounding — according to
the currency that is being formatted. That can be seen in the above chart,
with the difference between Yen and Euro formatting.</p><p>Details of the number formats are described in the
<a href="http://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns">Unicode documentation</a></p>
</section>
<section id="summary" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#summary">
<i class="ri-link-m" aria-hidden="true"></i>
Summary
</a>
</h1>
<div class="summary-functions summary">
<h2>
<a href="#functions">Functions</a>
</h2>
<div class="summary-row">
<div class="summary-signature">
<a href="#all_formats_for/1" translate="no">all_formats_for(locale \\ Plausible.Cldr.get_locale())</a>
</div>
<div class="summary-synopsis"><p>Returns the decimal formats defined for a given locale.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#all_formats_for!/1" translate="no">all_formats_for!(locale \\ Plausible.Cldr.get_locale())</a>
</div>
<div class="summary-synopsis"><p>Returns the decimal formats defined for a given locale.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#currency_spacing/2" translate="no">currency_spacing(locale, number_system)</a>
</div>
<div class="summary-synopsis"><p>Returns the currency space for a given locale and
number system.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#decimal_format_list/0" translate="no">decimal_format_list()</a>
</div>
<div class="summary-synopsis"><p>Returns the list of decimal formats in the configured locales including
the list of locales configured for precompilation in <code class="inline">config.exs</code>.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#decimal_format_list_for/1" translate="no">decimal_format_list_for(locale \\ Plausible.Cldr.get_locale())</a>
</div>
<div class="summary-synopsis"><p>Returns the list of decimal formats for a configured locale.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#default_grouping_for/1" translate="no">default_grouping_for(locale \\ Plausible.Cldr.get_locale())</a>
</div>
<div class="summary-synopsis"><p>Returns the default grouping for a locale as a map.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#default_grouping_for!/1" translate="no">default_grouping_for!(locale)</a>
</div>
<div class="summary-synopsis"><p>Returns the default grouping for a locale
or raises on error.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#formats_for/2" translate="no">formats_for(locale \\ Plausible.Cldr.default_locale(), number_system \\ Cldr.Number.System.default_number_system_type())</a>
</div>
<div class="summary-synopsis"><p>Return the predfined formats for a given <code class="inline">locale</code> and <code class="inline">number_system</code>.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#formats_for!/2" translate="no">formats_for!(locale \\ Plausible.Cldr.default_locale(), number_system \\ Cldr.Number.System.default_number_system_type())</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#minimum_grouping_digits_for/1" translate="no">minimum_grouping_digits_for(locale \\ Plausible.Cldr.get_locale())</a>
</div>
<div class="summary-synopsis"><p>Returns the minimum grouping digits for a locale.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#minimum_grouping_digits_for!/1" translate="no">minimum_grouping_digits_for!(locale)</a>
</div>
<div class="summary-synopsis"><p>Returns the minimum grouping digits for a locale
or raises on error.</p></div>
</div>
</div>
</section>
<section id="functions" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#functions">
<i class="ri-link-m" aria-hidden="true"></i>
Functions
</a>
</h1>
<div class="functions-list">
<section class="detail" id="all_formats_for/1">
<span id="all_formats_for/0"></span>
<div class="detail-header">
<a href="#all_formats_for/1" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">all_formats_for(locale \\ Plausible.Cldr.get_locale())</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/cldr.ex#L1" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@spec</span> all_formats_for(<a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html#t:t/0">Cldr.LanguageTag.t</a>() | <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.Locale.html#t:locale_name/0">Cldr.Locale.locale_name</a>()) ::
{:ok, <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">map</a>()} | {:error, {<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">module</a>(), <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()}}</pre>
</div>
<p>Returns the decimal formats defined for a given locale.</p><h2 id="all_formats_for/1-arguments" class="section-heading">
<a href="#all_formats_for/1-arguments">
<i class="ri-link-m" aria-hidden="true"></i>
Arguments
</a>
</h2>
<ul><li><code class="inline">locale</code> is any valid locale name returned by
<a href="Plausible.Cldr.html#known_locale_names/0"><code class="inline">Plausible.Cldr.known_locale_names/0</code></a>
or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code class="inline">Cldr.LanguageTag</code></a> struct returned by
<a href="Plausible.Cldr.Locale.html#new!/1"><code class="inline">Plausible.Cldr.Locale.new!/1</code></a>. The default
is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cldr.get_locale/0</code></a>.</li></ul><h2 id="all_formats_for/1-returns" class="section-heading">
<a href="#all_formats_for/1-returns">
<i class="ri-link-m" aria-hidden="true"></i>
Returns
</a>
</h2>
<ul><li><p><code class="inline">{:ok, map}</code> where map is a map of decimal formats
keyed by number system or</p></li><li><p><code class="inline">{:error, {exception, message}}</code></p></li></ul>
</section>
</section>
<section class="detail" id="all_formats_for!/1">
<span id="all_formats_for!/0"></span>
<div class="detail-header">
<a href="#all_formats_for!/1" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">all_formats_for!(locale \\ Plausible.Cldr.get_locale())</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/cldr.ex#L1" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@spec</span> all_formats_for!(<a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html#t:t/0">Cldr.LanguageTag.t</a>() | <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.Locale.html#t:locale_name/0">Cldr.Locale.locale_name</a>()) ::
<a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">map</a>() | <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">no_return</a>()</pre>
</div>
<p>Returns the decimal formats defined for a given locale.</p><h2 id="all_formats_for!/1-arguments" class="section-heading">
<a href="#all_formats_for!/1-arguments">
<i class="ri-link-m" aria-hidden="true"></i>
Arguments
</a>
</h2>
<ul><li><code class="inline">locale</code> is any valid locale name returned by
<a href="Plausible.Cldr.html#known_locale_names/0"><code class="inline">Plausible.Cldr.known_locale_names/0</code></a>
or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code class="inline">Cldr.LanguageTag</code></a> struct returned by
<a href="Plausible.Cldr.Locale.html#new!/1"><code class="inline">Plausible.Cldr.Locale.new!/1</code></a>. The default
is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cldr.get_locale/0</code></a>.</li></ul><h2 id="all_formats_for!/1-returns" class="section-heading">
<a href="#all_formats_for!/1-returns">
<i class="ri-link-m" aria-hidden="true"></i>
Returns
</a>
</h2>
<ul><li><p><code class="inline">{:ok, map}</code> where map is a map of decimal formats
keyed by number system or</p></li><li><p>raises an exception</p></li></ul><p>See <code class="inline">Plausible.Cldr.Number.Format.Number.Format.all_formats_for/1</code> for further information.</p>
</section>
</section>
<section class="detail" id="currency_spacing/2">
<div class="detail-header">
<a href="#currency_spacing/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">currency_spacing(locale, number_system)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/cldr.ex#L1" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@spec</span> currency_spacing(
<a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html#t:t/0">Cldr.LanguageTag.t</a>() | <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.Locale.html#t:locale_name/0">Cldr.Locale.locale_name</a>(),
<a href="https://hexdocs.pm/ex_cldr_numbers/2.31.3/Cldr.Number.System.html#t:system_name/0">Cldr.Number.System.system_name</a>()
) :: <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">map</a>() | {:error, {<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">module</a>(), <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()}}</pre>
</div>
<p>Returns the currency space for a given locale and
number system.</p>
</section>
</section>
<section class="detail" id="decimal_format_list/0">
<div class="detail-header">
<a href="#decimal_format_list/0" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">decimal_format_list()</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/cldr.ex#L1" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@spec</span> decimal_format_list() :: [<a href="https://hexdocs.pm/ex_cldr_numbers/2.31.3/Cldr.Number.Format.html#t:format/0">Cldr.Number.Format.format</a>()]</pre>
</div>
<p>Returns the list of decimal formats in the configured locales including
the list of locales configured for precompilation in <code class="inline">config.exs</code>.</p><p>This function exists to allow the decimal formatter
to precompile all the known formats at compile time.</p><h2 id="decimal_format_list/0-example" class="section-heading">
<a href="#decimal_format_list/0-example">
<i class="ri-link-m" aria-hidden="true"></i>
Example
</a>
</h2>
<pre><code class="makeup elixir" translate="no"><span class="c1">#=&gt; Plausible.Cldr.Number.Format.Format.decimal_format_list</span><span class="w">
</span><span class="p" data-group-id="2557666615-1">[</span><span class="s">&quot;#&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#,##,##0%&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;#,##,##0.###&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#,##,##0.00¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#,##,##0.00¤;(#,##,##0.00¤)&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;#,##,##0 %&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#,##0%&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#,##0.###&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#,##0.00 ¤&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;#,##0.00 ¤;(#,##0.00 ¤)&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#,##0.00¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#,##0.00¤;(#,##0.00¤)&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;#,##0 %&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#0%&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#0.######&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#0.00 ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#E0&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;%#,##0&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;% #,##0&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;0&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;0.000000E+000&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;0000 M ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;0000¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000G ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000K ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000M ¤&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;000T ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000mM ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000m ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 Bio&#39;.&#39; ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 Bln ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 Bn ¤&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;000 B ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 E ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 K ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 MRD ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 Md ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 Mio&#39;.&#39; ¤&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;000 Mio ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 Mld ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 Mln ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 Mn ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 Mrd&#39;.&#39; ¤&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;000 Mrd ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 Mr ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 M ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 NT ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 N ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 Tn ¤&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;000 Tr ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">...</span><span class="p" data-group-id="2557666615-1">]</span></code></pre>
</section>
</section>
<section class="detail" id="decimal_format_list_for/1">
<span id="decimal_format_list_for/0"></span>
<div class="detail-header">
<a href="#decimal_format_list_for/1" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">decimal_format_list_for(locale \\ Plausible.Cldr.get_locale())</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/cldr.ex#L1" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@spec</span> decimal_format_list_for(<a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html#t:t/0">Cldr.LanguageTag.t</a>() | <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.Locale.html#t:locale_name/0">Cldr.Locale.locale_name</a>()) ::
{:ok, [<a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()]} | {:error, {<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">module</a>(), <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()}}</pre>
</div>
<p>Returns the list of decimal formats for a configured locale.</p><h2 id="decimal_format_list_for/1-arguments" class="section-heading">
<a href="#decimal_format_list_for/1-arguments">
<i class="ri-link-m" aria-hidden="true"></i>
Arguments
</a>
</h2>
<ul><li><code class="inline">locale</code> is any valid locale name returned by
<a href="Plausible.Cldr.html#known_locale_names/0"><code class="inline">Plausible.Cldr.known_locale_names/0</code></a>
or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code class="inline">Cldr.LanguageTag</code></a> struct returned by
<a href="Plausible.Cldr.Locale.html#new!/1"><code class="inline">Plausible.Cldr.Locale.new!/1</code></a>. The default
is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cldr.get_locale/0</code></a>.</li></ul><p>This function exists to allow the decimal formatter to precompile all
the known formats at compile time. Its use is not otherwise recommended.</p><h2 id="decimal_format_list_for/1-example" class="section-heading">
<a href="#decimal_format_list_for/1-example">
<i class="ri-link-m" aria-hidden="true"></i>
Example
</a>
</h2>
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex&gt; </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">decimal_format_list_for</span><span class="p" data-group-id="2399232664-1">(</span><span class="ss">:en</span><span class="p" data-group-id="2399232664-1">)</span><span class="w">
</span><span class="p" data-group-id="2399232664-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2399232664-3">[</span><span class="s">&quot;#,##0%&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#,##0.###&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#,##0.00&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;#,##0.00;(#,##0.00)&quot;</span><span class="p">,</span><span class="s">&quot;#E0&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;0 billion&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;0 million&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;0 thousand&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;0 trillion&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;00 billion&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;00 million&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;00 thousand&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;00 trillion&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;000 billion&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 million&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 thousand&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000 trillion&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000B&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000K&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;000M&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;000T&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;00B&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;00K&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;00M&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;00T&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;0B&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;0K&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;0M&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;0T&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;¤#,##0.00&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤#,##0.00;(¤#,##0.00)&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤000B&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤000K&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤000M&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;¤000T&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤00B&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤00K&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤00M&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤00T&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤0B&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤0K&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤0M&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤0T&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;¤ #,##0.00&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤ #,##0.00;(¤ #,##0.00)&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤ 000B&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤ 000K&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤ 000M&quot;</span><span class="p">,</span><span class="w">
</span><span class="s">&quot;¤ 000T&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤ 00B&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤ 00K&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤ 00M&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤ 00T&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤ 0B&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤ 0K&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤ 0M&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;¤ 0T&quot;</span><span class="p" data-group-id="2399232664-3">]</span><span class="p" data-group-id="2399232664-2">}</span></code></pre>
</section>
</section>
<section class="detail" id="default_grouping_for/1">
<span id="default_grouping_for/0"></span>
<div class="detail-header">
<a href="#default_grouping_for/1" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">default_grouping_for(locale \\ Plausible.Cldr.get_locale())</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/cldr.ex#L1" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@spec</span> default_grouping_for(<a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html#t:t/0">Cldr.LanguageTag.t</a>() | <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.Locale.html#t:locale_name/0">Cldr.Locale.locale_name</a>()) ::
{:ok, <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">map</a>()} | {:error, {<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">module</a>(), <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()}}</pre>
</div>
<p>Returns the default grouping for a locale as a map.</p><h2 id="default_grouping_for/1-arguments" class="section-heading">
<a href="#default_grouping_for/1-arguments">
<i class="ri-link-m" aria-hidden="true"></i>
Arguments
</a>
</h2>
<ul><li><code class="inline">locale</code> is any valid locale name returned by
<a href="Plausible.Cldr.html#known_locale_names/0"><code class="inline">Plausible.Cldr.known_locale_names/0</code></a>
or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code class="inline">Cldr.LanguageTag</code></a> struct returned by
<a href="Plausible.Cldr.Locale.html#new!/1"><code class="inline">Plausible.Cldr.Locale.new!/1</code></a>. The default
is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cldr.get_locale/0</code></a>.</li></ul><h2 id="default_grouping_for/1-returns" class="section-heading">
<a href="#default_grouping_for/1-returns">
<i class="ri-link-m" aria-hidden="true"></i>
Returns
</a>
</h2>
<ul><li><p><code class="inline">{:ok, grouping}</code> or</p></li><li><p><code class="inline">{:error, {exception, message}}</code></p></li></ul><h2 id="default_grouping_for/1-examples" class="section-heading">
<a href="#default_grouping_for/1-examples">
<i class="ri-link-m" aria-hidden="true"></i>
Examples
</a>
</h2>
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex&gt; </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">default_grouping_for</span><span class="p" data-group-id="4136747763-1">(</span><span class="ss">:en</span><span class="p" data-group-id="4136747763-1">)</span><span class="w">
</span><span class="p" data-group-id="4136747763-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4136747763-3">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4136747763-4">%{</span><span class="ss">first</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="ss">rest</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="4136747763-4">}</span><span class="p">,</span><span class="w"> </span><span class="ss">integer</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4136747763-5">%{</span><span class="ss">first</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="ss">rest</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p" data-group-id="4136747763-5">}</span><span class="p" data-group-id="4136747763-3">}</span><span class="p" data-group-id="4136747763-2">}</span></code></pre>
</section>
</section>
<section class="detail" id="default_grouping_for!/1">
<div class="detail-header">
<a href="#default_grouping_for!/1" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">default_grouping_for!(locale)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/cldr.ex#L1" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@spec</span> default_grouping_for!(<a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html#t:t/0">Cldr.LanguageTag.t</a>() | <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.Locale.html#t:locale_name/0">Cldr.Locale.locale_name</a>()) ::
<a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">map</a>() | <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">no_return</a>()</pre>
</div>
<p>Returns the default grouping for a locale
or raises on error.</p><h2 id="default_grouping_for!/1-arguments" class="section-heading">
<a href="#default_grouping_for!/1-arguments">
<i class="ri-link-m" aria-hidden="true"></i>
Arguments
</a>
</h2>
<ul><li><code class="inline">locale</code> is any valid locale name returned by
<a href="Plausible.Cldr.html#known_locale_names/0"><code class="inline">Plausible.Cldr.known_locale_names/0</code></a>
or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code class="inline">Cldr.LanguageTag</code></a> struct returned by
<a href="Plausible.Cldr.Locale.html#new!/1"><code class="inline">Plausible.Cldr.Locale.new!/1</code></a>. The default
is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cldr.get_locale/0</code></a>.</li></ul><h2 id="default_grouping_for!/1-returns" class="section-heading">
<a href="#default_grouping_for!/1-returns">
<i class="ri-link-m" aria-hidden="true"></i>
Returns
</a>
</h2>
<ul><li><p><code class="inline">grouping</code> as a map or</p></li><li><p>raises an exception</p></li></ul><h2 id="default_grouping_for!/1-examples" class="section-heading">
<a href="#default_grouping_for!/1-examples">
<i class="ri-link-m" aria-hidden="true"></i>
Examples
</a>
</h2>
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex&gt; </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">default_grouping_for!</span><span class="p" data-group-id="4844158915-1">(</span><span class="ss">:en</span><span class="p" data-group-id="4844158915-1">)</span><span class="w">
</span><span class="p" data-group-id="4844158915-2">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4844158915-3">%{</span><span class="ss">first</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="ss">rest</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="4844158915-3">}</span><span class="p">,</span><span class="w"> </span><span class="ss">integer</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4844158915-4">%{</span><span class="ss">first</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="ss">rest</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p" data-group-id="4844158915-4">}</span><span class="p" data-group-id="4844158915-2">}</span></code></pre>
</section>
</section>
<section class="detail" id="formats_for/2">
<span id="formats_for/0"></span>
<span id="formats_for/1"></span>
<div class="detail-header">
<a href="#formats_for/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">formats_for(locale \\ Plausible.Cldr.default_locale(), number_system \\ Cldr.Number.System.default_number_system_type())</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/cldr.ex#L1" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@spec</span> formats_for(<a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html#t:t/0">Cldr.LanguageTag.t</a>() | <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">binary</a>(), <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">atom</a>() | <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()) ::
{:ok, <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">map</a>()} | {:error, {<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">module</a>(), <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()}}</pre>
</div>
<p>Return the predfined formats for a given <code class="inline">locale</code> and <code class="inline">number_system</code>.</p><h2 id="formats_for/2-arguments" class="section-heading">
<a href="#formats_for/2-arguments">
<i class="ri-link-m" aria-hidden="true"></i>
Arguments
</a>
</h2>
<ul><li><p><code class="inline">locale</code> is any valid locale name returned by
<a href="Plausible.Cldr.html#known_locale_names/0"><code class="inline">Plausible.Cldr.known_locale_names/0</code></a>
or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code class="inline">Cldr.LanguageTag</code></a> struct returned by
<a href="Plausible.Cldr.Locale.html#new!/1"><code class="inline">Plausible.Cldr.Locale.new!/1</code></a>. The default
is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cldr.get_locale/0</code></a>.</p></li><li><p><code class="inline">number_system</code> is any valid number system or number system type returned
by <a href="Plausible.Cldr.Number.System.html#number_systems_for/1"><code class="inline">Plausible.Cldr.Number.System.number_systems_for/1</code></a>.</p></li></ul><h2 id="formats_for/2-example" class="section-heading">
<a href="#formats_for/2-example">
<i class="ri-link-m" aria-hidden="true"></i>
Example
</a>
</h2>
<pre><code class="makeup elixir" translate="no"><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">formats_for</span><span class="w"> </span><span class="ss">:fr</span><span class="p">,</span><span class="w"> </span><span class="ss">:native</span><span class="w">
</span><span class="c1">#=&gt; %Cldr.Number.Format{</span><span class="w">
</span><span class="ss">accounting</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;#,##0.00 ¤;(#,##0.00 ¤)&quot;</span><span class="p">,</span><span class="w">
</span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;#,##0.00 ¤&quot;</span><span class="p">,</span><span class="w">
</span><span class="ss">percent</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;#,##0 %&quot;</span><span class="p">,</span><span class="w">
</span><span class="ss">scientific</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;#E0&quot;</span><span class="p">,</span><span class="w">
</span><span class="ss">standard</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;#,##0.###&quot;</span><span class="w">
</span><span class="ss">currency_short</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8555732699-1">[</span><span class="p" data-group-id="8555732699-2">{</span><span class="s">&quot;1000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8555732699-3">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;0 k ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;0 k ¤&quot;</span><span class="p" data-group-id="8555732699-3">]</span><span class="p" data-group-id="8555732699-2">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8555732699-4">{</span><span class="s">&quot;10000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8555732699-5">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;00 k ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;00 k ¤&quot;</span><span class="p" data-group-id="8555732699-5">]</span><span class="p" data-group-id="8555732699-4">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8555732699-6">{</span><span class="s">&quot;100000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8555732699-7">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;000 k ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;000 k ¤&quot;</span><span class="p" data-group-id="8555732699-7">]</span><span class="p" data-group-id="8555732699-6">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8555732699-8">{</span><span class="s">&quot;1000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8555732699-9">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;0 M ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;0 M ¤&quot;</span><span class="p" data-group-id="8555732699-9">]</span><span class="p" data-group-id="8555732699-8">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8555732699-10">{</span><span class="s">&quot;10000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8555732699-11">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;00 M ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;00 M ¤&quot;</span><span class="p" data-group-id="8555732699-11">]</span><span class="p" data-group-id="8555732699-10">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8555732699-12">{</span><span class="s">&quot;100000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8555732699-13">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;000 M ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;000 M ¤&quot;</span><span class="p" data-group-id="8555732699-13">]</span><span class="p" data-group-id="8555732699-12">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8555732699-14">{</span><span class="s">&quot;1000000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8555732699-15">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;0 Md ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;0 Md ¤&quot;</span><span class="p" data-group-id="8555732699-15">]</span><span class="p" data-group-id="8555732699-14">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8555732699-16">{</span><span class="s">&quot;10000000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8555732699-17">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;00 Md ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;00 Md ¤&quot;</span><span class="p" data-group-id="8555732699-17">]</span><span class="p" data-group-id="8555732699-16">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8555732699-18">{</span><span class="s">&quot;100000000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8555732699-19">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;000 Md ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;000 Md ¤&quot;</span><span class="p" data-group-id="8555732699-19">]</span><span class="p" data-group-id="8555732699-18">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8555732699-20">{</span><span class="s">&quot;1000000000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8555732699-21">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;0 Bn ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;0 Bn ¤&quot;</span><span class="p" data-group-id="8555732699-21">]</span><span class="p" data-group-id="8555732699-20">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8555732699-22">{</span><span class="s">&quot;10000000000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8555732699-23">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;00 Bn ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;00 Bn ¤&quot;</span><span class="p" data-group-id="8555732699-23">]</span><span class="p" data-group-id="8555732699-22">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8555732699-24">{</span><span class="s">&quot;100000000000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8555732699-25">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;000 Bn ¤&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;000 Bn ¤&quot;</span><span class="p" data-group-id="8555732699-25">]</span><span class="p" data-group-id="8555732699-24">}</span><span class="p" data-group-id="8555732699-1">]</span><span class="p">,</span><span class="w">
</span><span class="n">...</span><span class="w">
</span><span class="err">}</span></code></pre>
</section>
</section>
<section class="detail" id="formats_for!/2">
<span id="formats_for!/0"></span>
<span id="formats_for!/1"></span>
<div class="detail-header">
<a href="#formats_for!/2" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">formats_for!(locale \\ Plausible.Cldr.default_locale(), number_system \\ Cldr.Number.System.default_number_system_type())</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/cldr.ex#L1" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@spec</span> formats_for!(
<a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html#t:t/0">Cldr.LanguageTag.t</a>() | <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.Locale.html#t:locale_name/0">Cldr.Locale.locale_name</a>(),
<a href="https://hexdocs.pm/ex_cldr_numbers/2.31.3/Cldr.Number.System.html#t:system_name/0">Cldr.Number.System.system_name</a>()
) ::
<a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">map</a>() | <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">no_return</a>()</pre>
</div>
</section>
</section>
<section class="detail" id="minimum_grouping_digits_for/1">
<span id="minimum_grouping_digits_for/0"></span>
<div class="detail-header">
<a href="#minimum_grouping_digits_for/1" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">minimum_grouping_digits_for(locale \\ Plausible.Cldr.get_locale())</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/cldr.ex#L1" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@spec</span> minimum_grouping_digits_for(<a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html#t:t/0">Cldr.LanguageTag.t</a>() | <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.Locale.html#t:locale_name/0">Cldr.Locale.locale_name</a>()) ::
{:ok, <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">non_neg_integer</a>()} | {:error, {<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">module</a>(), <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()}}</pre>
</div>
<p>Returns the minimum grouping digits for a locale.</p><h2 id="minimum_grouping_digits_for/1-arguments" class="section-heading">
<a href="#minimum_grouping_digits_for/1-arguments">
<i class="ri-link-m" aria-hidden="true"></i>
Arguments
</a>
</h2>
<ul><li><code class="inline">locale</code> is any valid locale name returned by
<a href="Plausible.Cldr.html#known_locale_names/0"><code class="inline">Plausible.Cldr.known_locale_names/0</code></a>
or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code class="inline">Cldr.LanguageTag</code></a> struct returned by
<a href="Plausible.Cldr.Locale.html#new!/1"><code class="inline">Plausible.Cldr.Locale.new!/1</code></a>. The default
is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cldr.get_locale/0</code></a>.</li></ul><h2 id="minimum_grouping_digits_for/1-returns" class="section-heading">
<a href="#minimum_grouping_digits_for/1-returns">
<i class="ri-link-m" aria-hidden="true"></i>
Returns
</a>
</h2>
<ul><li><p><code class="inline">{:ok, minumum_digits}</code> or</p></li><li><p><code class="inline">{:error, {exception, message}}</code></p></li></ul><h2 id="minimum_grouping_digits_for/1-examples" class="section-heading">
<a href="#minimum_grouping_digits_for/1-examples">
<i class="ri-link-m" aria-hidden="true"></i>
Examples
</a>
</h2>
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex&gt; </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">minimum_grouping_digits_for</span><span class="p" data-group-id="9413860983-1">(</span><span class="s">&quot;en&quot;</span><span class="p" data-group-id="9413860983-1">)</span><span class="w">
</span><span class="p" data-group-id="9413860983-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p" data-group-id="9413860983-2">}</span></code></pre>
</section>
</section>
<section class="detail" id="minimum_grouping_digits_for!/1">
<div class="detail-header">
<a href="#minimum_grouping_digits_for!/1" class="detail-link" title="Link to this function">
<i class="ri-link-m" aria-hidden="true"></i>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature" translate="no">minimum_grouping_digits_for!(locale)</h1>
<a href="https://github.com/plausible/analytics/blob/main/lib/plausible/cldr.ex#L1" class="icon-action" rel="help" title="View Source">
<i class="ri-code-s-slash-line" aria-hidden="true"></i>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<div class="specs">
<pre translate="no"><span class="attribute">@spec</span> minimum_grouping_digits_for!(<a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html#t:t/0">Cldr.LanguageTag.t</a>() | <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.Locale.html#t:locale_name/0">Cldr.Locale.locale_name</a>()) ::
<a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">non_neg_integer</a>() | <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">no_return</a>()</pre>
</div>
<p>Returns the minimum grouping digits for a locale
or raises on error.</p><h2 id="minimum_grouping_digits_for!/1-arguments" class="section-heading">
<a href="#minimum_grouping_digits_for!/1-arguments">
<i class="ri-link-m" aria-hidden="true"></i>
Arguments
</a>
</h2>
<ul><li><code class="inline">locale</code> is any valid locale name returned by
<a href="Plausible.Cldr.html#known_locale_names/0"><code class="inline">Plausible.Cldr.known_locale_names/0</code></a>
or a <a href="https://hexdocs.pm/ex_cldr/2.37.2/Cldr.LanguageTag.html"><code class="inline">Cldr.LanguageTag</code></a> struct returned by
<a href="Plausible.Cldr.Locale.html#new!/1"><code class="inline">Plausible.Cldr.Locale.new!/1</code></a>. The default
is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cldr.get_locale/0</code></a>.</li></ul><h2 id="minimum_grouping_digits_for!/1-returns" class="section-heading">
<a href="#minimum_grouping_digits_for!/1-returns">
<i class="ri-link-m" aria-hidden="true"></i>
Returns
</a>
</h2>
<ul><li><p><code class="inline">minumum_digits</code> or</p></li><li><p>raises an exception</p></li></ul><h2 id="minimum_grouping_digits_for!/1-examples" class="section-heading">
<a href="#minimum_grouping_digits_for!/1-examples">
<i class="ri-link-m" aria-hidden="true"></i>
Examples
</a>
</h2>
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex&gt; </span><span class="nc">Plausible.Cldr.Number.Format</span><span class="o">.</span><span class="n">minimum_grouping_digits_for!</span><span class="p" data-group-id="9826453899-1">(</span><span class="s">&quot;en&quot;</span><span class="p" data-group-id="9826453899-1">)</span><span class="w">
</span><span class="mi">1</span></code></pre>
</section>
</section>
</div>
</section>
<footer class="footer">
<p>
<span class="line">
<button class="a-main footer-button display-quick-switch" title="Search HexDocs packages">
Search HexDocs
</button>
<a href="Plausible.epub" title="ePub version">
Download ePub version
</a>
</span>
</p>
<p class="built-using">
Built using
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" target="_blank" rel="help noopener" translate="no">ExDoc</a> (v0.30.3) for the
<a href="https://elixir-lang.org" title="Elixir" target="_blank" translate="no">Elixir programming language</a>
</p>
</footer>
</div>
</div>
</section>
</div>
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad: true})</script>
</body>
</html>