analytics/Plausible.Cldr.Number.Format.html
github-merge-queue[bot] edd7f59258 deploy: 7b49dd33c7
2024-11-20 08:26:00 +00:00

899 lines
62 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.31.1">
<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-FM2CSD74.css" />
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
<script src="dist/sidebar_items-A3DEA188.js"></script>
<script src="docs_config.js"></script>
<script async src="dist/html-L4O5OK2K.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 id="sidebar-menu" class="sidebar-button sidebar-toggle" aria-label="toggle sidebar" aria-controls="sidebar">
<i class="ri-menu-line ri-lg" title="Collapse/expand sidebar"></i>
</button>
<div class="background-layer"></div>
<nav id="sidebar" class="sidebar">
<div class="sidebar-header">
<div class="sidebar-projectInfo">
<a href="readme.html" class="sidebar-projectImage">
<img src="assets/logo.png" alt="Plausible" />
</a>
<div>
<a href="readme.html" class="sidebar-projectName" translate="no">
Plausible
</a>
<div class="sidebar-projectVersion" translate="no">
v0.0.1
</div>
</div>
</div>
<ul id="sidebar-listNav" class="sidebar-listNav" role="tablist">
<li>
<button id="extras-list-tab-button" role="tab" data-type="extras" aria-controls="extras-tab-panel" aria-selected="true" tabindex="0">
Pages
</button>
</li>
<li>
<button id="modules-list-tab-button" role="tab" data-type="modules" aria-controls="modules-tab-panel" aria-selected="false" tabindex="-1">
Modules
</button>
</li>
<li>
<button id="tasks-list-tab-button" role="tab" data-type="tasks" aria-controls="tasks-tab-panel" aria-selected="false" tabindex="-1">
<span translate="no">Mix</span> Tasks
</button>
</li>
</ul>
</div>
<div id="extras-tab-panel" class="sidebar-tabpanel" role="tabpanel" aria-labelledby="extras-list-tab-button">
<ul id="extras-full-list" class="full-list"></ul>
</div>
<div id="modules-tab-panel" class="sidebar-tabpanel" role="tabpanel" aria-labelledby="modules-list-tab-button" hidden>
<ul id="modules-full-list" class="full-list"></ul>
</div>
<div id="tasks-tab-panel" class="sidebar-tabpanel" role="tabpanel" aria-labelledby="tasks-list-tab-button" hidden>
<ul id="tasks-full-list" class="full-list"></ul>
</div>
</nav>
<main class="content">
<output role="status" id="toast"></output>
<div class="content-outer">
<div id="content" class="content-inner">
<div class="top-search">
<div class="search-settings">
<form class="search-bar" action="search.html">
<label class="search-label">
<span class="sr-only">Search documentation of Plausible</span>
<input name="q" type="text" class="search-input" placeholder="Search Documentation (press /)" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
</label>
<button type="submit" class="search-button" aria-label="Submit Search">
<i class="ri-search-2-line ri-lg" aria-hidden="true" title="Submit search"></i>
</button>
<button type="button" tabindex="-1" class="search-close-button" aria-hidden="true">
<i class="ri-close-line ri-lg" title="Cancel search"></i>
</button>
</form>
<div class="autocomplete">
</div>
<button class="icon-settings display-settings">
<i class="ri-settings-3-line"></i>
<span class="sr-only">Settings</span>
</button>
</div>
</div>
<h1>
<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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Number Pattern Examples</span>
</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>
</a>
<span class="text">Summary</span>
</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>
</a>
<span class="text">Functions</span>
</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.39.2/Cldr.Locale.html#t:locale_reference/0">Cldr.Locale.locale_reference</a>()) ::
{:ok, %{required(<a href="https://hexdocs.pm/ex_cldr_numbers/2.33.1/Cldr.Number.System.html#t:system_name/0">Cldr.Number.System.system_name</a>()) =&gt; <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>
<pre translate="no"><span class="attribute">@spec</span> all_formats_for(<a href="https://hexdocs.pm/ex_cldr/2.39.2/Cldr.Locale.html#t:locale_reference/0">Cldr.Locale.locale_reference</a>()) ::
%{required(<a href="https://hexdocs.pm/ex_cldr_numbers/2.33.1/Cldr.Number.System.html#t:system_name/0">Cldr.Number.System.system_name</a>()) =&gt; <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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Arguments</span>
</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.39.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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Returns</span>
</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">
<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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Arguments</span>
</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.39.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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Returns</span>
</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.39.2/Cldr.LanguageTag.html#t:t/0">Cldr.LanguageTag.t</a>() | <a href="https://hexdocs.pm/ex_cldr/2.39.2/Cldr.Locale.html#t:locale_name/0">Cldr.Locale.locale_name</a>(),
<a href="https://hexdocs.pm/ex_cldr_numbers/2.33.1/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.33.1/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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Example</span>
</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="4193947040-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="4193947040-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.39.2/Cldr.LanguageTag.html#t:t/0">Cldr.LanguageTag.t</a>() | <a href="https://hexdocs.pm/ex_cldr/2.39.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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Arguments</span>
</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.39.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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Example</span>
</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="0609215278-1">(</span><span class="ss">:en</span><span class="p" data-group-id="0609215278-1">)</span><span class="w">
</span><span class="p" data-group-id="0609215278-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0609215278-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="0609215278-3">]</span><span class="p" data-group-id="0609215278-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.39.2/Cldr.Locale.html#t:locale_reference/0">Cldr.Locale.locale_reference</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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Arguments</span>
</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.39.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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Returns</span>
</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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Examples</span>
</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="6234385728-1">(</span><span class="ss">:en</span><span class="p" data-group-id="6234385728-1">)</span><span class="w">
</span><span class="p" data-group-id="6234385728-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6234385728-3">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6234385728-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="6234385728-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="6234385728-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="6234385728-5">}</span><span class="p" data-group-id="6234385728-3">}</span><span class="p" data-group-id="6234385728-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.39.2/Cldr.Locale.html#t:locale_reference/0">Cldr.Locale.locale_reference</a>()) ::
%{
fraction: %{first: <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">non_neg_integer</a>(), rest: <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">non_neg_integer</a>()},
integer: %{first: <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">non_neg_integer</a>(), rest: <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 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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Arguments</span>
</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.39.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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Returns</span>
</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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Examples</span>
</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="3585794384-1">(</span><span class="ss">:en</span><span class="p" data-group-id="3585794384-1">)</span><span class="w">
</span><span class="p" data-group-id="3585794384-2">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="3585794384-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="3585794384-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="3585794384-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="3585794384-4">}</span><span class="p" data-group-id="3585794384-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.39.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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Arguments</span>
</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.39.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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Example</span>
</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="8786136416-1">[</span><span class="p" data-group-id="8786136416-2">{</span><span class="s">&quot;1000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8786136416-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="8786136416-3">]</span><span class="p" data-group-id="8786136416-2">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8786136416-4">{</span><span class="s">&quot;10000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8786136416-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="8786136416-5">]</span><span class="p" data-group-id="8786136416-4">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8786136416-6">{</span><span class="s">&quot;100000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8786136416-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="8786136416-7">]</span><span class="p" data-group-id="8786136416-6">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8786136416-8">{</span><span class="s">&quot;1000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8786136416-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="8786136416-9">]</span><span class="p" data-group-id="8786136416-8">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8786136416-10">{</span><span class="s">&quot;10000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8786136416-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="8786136416-11">]</span><span class="p" data-group-id="8786136416-10">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8786136416-12">{</span><span class="s">&quot;100000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8786136416-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="8786136416-13">]</span><span class="p" data-group-id="8786136416-12">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8786136416-14">{</span><span class="s">&quot;1000000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8786136416-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="8786136416-15">]</span><span class="p" data-group-id="8786136416-14">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8786136416-16">{</span><span class="s">&quot;10000000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8786136416-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="8786136416-17">]</span><span class="p" data-group-id="8786136416-16">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8786136416-18">{</span><span class="s">&quot;100000000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8786136416-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="8786136416-19">]</span><span class="p" data-group-id="8786136416-18">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8786136416-20">{</span><span class="s">&quot;1000000000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8786136416-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="8786136416-21">]</span><span class="p" data-group-id="8786136416-20">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8786136416-22">{</span><span class="s">&quot;10000000000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8786136416-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="8786136416-23">]</span><span class="p" data-group-id="8786136416-22">}</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="8786136416-24">{</span><span class="s">&quot;100000000000000&quot;</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8786136416-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="8786136416-25">]</span><span class="p" data-group-id="8786136416-24">}</span><span class="p" data-group-id="8786136416-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.39.2/Cldr.LanguageTag.html#t:t/0">Cldr.LanguageTag.t</a>() | <a href="https://hexdocs.pm/ex_cldr/2.39.2/Cldr.Locale.html#t:locale_name/0">Cldr.Locale.locale_name</a>(),
<a href="https://hexdocs.pm/ex_cldr_numbers/2.33.1/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.39.2/Cldr.Locale.html#t:locale_reference/0">Cldr.Locale.locale_reference</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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Arguments</span>
</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.39.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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Returns</span>
</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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Examples</span>
</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="7921014485-1">(</span><span class="s">&quot;en&quot;</span><span class="p" data-group-id="7921014485-1">)</span><span class="w">
</span><span class="p" data-group-id="7921014485-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="7921014485-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.39.2/Cldr.Locale.html#t:locale_reference/0">Cldr.Locale.locale_reference</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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Arguments</span>
</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.39.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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Returns</span>
</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" class="hover-link">
<i class="ri-link-m" aria-hidden="true"></i>
</a>
<span class="text">Examples</span>
</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="0168468938-1">(</span><span class="s">&quot;en&quot;</span><span class="p" data-group-id="0168468938-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.31.1) for the
<a href="https://elixir-lang.org" title="Elixir" target="_blank" translate="no">Elixir programming language</a>
</p>
</footer>
</div>
</div>
</main>
</div>
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad: true})</script>
</body>
</html>