mirror of
https://github.com/plausible/analytics.git
synced 2024-12-26 02:55:02 +03:00
869 lines
60 KiB
HTML
869 lines
60 KiB
HTML
<!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-1AED098E.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 "." shows where the
|
||
decimal point should go. The "," shows where the thousands separator should
|
||
go. A "0" indicates zero-padding: if the number is too short, a zero (in the
|
||
locale's numeric set) will go there. A "#" indicates no padding: if the
|
||
number is too short, nothing goes there. A "¤" shows where the currency sign
|
||
will go. The following illustrates the effects of different patterns for the
|
||
French locale, with the number "1234.567". 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">#=> Plausible.Cldr.Number.Format.Format.decimal_format_list</span><span class="w">
|
||
</span><span class="p" data-group-id="2900360537-1">[</span><span class="s">"#"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##,##0%"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"#,##,##0.###"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##,##0.00¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##,##0.00¤;(#,##,##0.00¤)"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"#,##,##0 %"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0%"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.###"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.00 ¤"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"#,##0.00 ¤;(#,##0.00 ¤)"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.00¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.00¤;(#,##0.00¤)"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"#,##0 %"</span><span class="p">,</span><span class="w"> </span><span class="s">"#0%"</span><span class="p">,</span><span class="w"> </span><span class="s">"#0.######"</span><span class="p">,</span><span class="w"> </span><span class="s">"#0.00 ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"#E0"</span><span class="p">,</span><span class="w"> </span><span class="s">"%#,##0"</span><span class="p">,</span><span class="w"> </span><span class="s">"% #,##0"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"0"</span><span class="p">,</span><span class="w"> </span><span class="s">"0.000000E+000"</span><span class="p">,</span><span class="w"> </span><span class="s">"0000 M ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"0000¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000G ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000K ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000M ¤"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"000T ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000mM ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000m ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Bio'.' ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Bln ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Bn ¤"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"000 B ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 E ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 K ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 MRD ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Md ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Mio'.' ¤"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"000 Mio ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Mld ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Mln ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Mn ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Mrd'.' ¤"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"000 Mrd ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Mr ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 M ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 NT ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 N ¤"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 Tn ¤"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"000 Tr ¤"</span><span class="p">,</span><span class="w"> </span><span class="n">...</span><span class="p" data-group-id="2900360537-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> </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="2735154752-1">(</span><span class="ss">:en</span><span class="p" data-group-id="2735154752-1">)</span><span class="w">
|
||
</span><span class="p" data-group-id="2735154752-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2735154752-3">[</span><span class="s">"#,##0%"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.###"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.00"</span><span class="p">,</span><span class="w"> </span><span class="s">"#,##0.00;(#,##0.00)"</span><span class="p">,</span><span class="s">"#E0"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"0 billion"</span><span class="p">,</span><span class="w"> </span><span class="s">"0 million"</span><span class="p">,</span><span class="w"> </span><span class="s">"0 thousand"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"0 trillion"</span><span class="p">,</span><span class="w"> </span><span class="s">"00 billion"</span><span class="p">,</span><span class="w"> </span><span class="s">"00 million"</span><span class="p">,</span><span class="w"> </span><span class="s">"00 thousand"</span><span class="p">,</span><span class="w"> </span><span class="s">"00 trillion"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"000 billion"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 million"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 thousand"</span><span class="p">,</span><span class="w"> </span><span class="s">"000 trillion"</span><span class="p">,</span><span class="w"> </span><span class="s">"000B"</span><span class="p">,</span><span class="w"> </span><span class="s">"000K"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"000M"</span><span class="p">,</span><span class="w"> </span><span class="s">"000T"</span><span class="p">,</span><span class="w"> </span><span class="s">"00B"</span><span class="p">,</span><span class="w"> </span><span class="s">"00K"</span><span class="p">,</span><span class="w"> </span><span class="s">"00M"</span><span class="p">,</span><span class="w"> </span><span class="s">"00T"</span><span class="p">,</span><span class="w"> </span><span class="s">"0B"</span><span class="p">,</span><span class="w"> </span><span class="s">"0K"</span><span class="p">,</span><span class="w"> </span><span class="s">"0M"</span><span class="p">,</span><span class="w"> </span><span class="s">"0T"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"¤#,##0.00"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤#,##0.00;(¤#,##0.00)"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤000B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤000K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤000M"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"¤000T"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤00B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤00K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤00M"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤00T"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤0B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤0K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤0M"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤0T"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"¤ #,##0.00"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ #,##0.00;(¤ #,##0.00)"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 000B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 000K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 000M"</span><span class="p">,</span><span class="w">
|
||
</span><span class="s">"¤ 000T"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 00B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 00K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 00M"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 00T"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 0B"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 0K"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 0M"</span><span class="p">,</span><span class="w"> </span><span class="s">"¤ 0T"</span><span class="p" data-group-id="2735154752-3">]</span><span class="p" data-group-id="2735154752-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> </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="9500465540-1">(</span><span class="ss">:en</span><span class="p" data-group-id="9500465540-1">)</span><span class="w">
|
||
</span><span class="p" data-group-id="9500465540-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9500465540-3">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9500465540-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="9500465540-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="9500465540-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="9500465540-5">}</span><span class="p" data-group-id="9500465540-3">}</span><span class="p" data-group-id="9500465540-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> </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="7253182612-1">(</span><span class="ss">:en</span><span class="p" data-group-id="7253182612-1">)</span><span class="w">
|
||
</span><span class="p" data-group-id="7253182612-2">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7253182612-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="7253182612-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="7253182612-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="7253182612-4">}</span><span class="p" data-group-id="7253182612-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">#=> %Cldr.Number.Format{</span><span class="w">
|
||
</span><span class="ss">accounting</span><span class="p">:</span><span class="w"> </span><span class="s">"#,##0.00 ¤;(#,##0.00 ¤)"</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">"#,##0.00 ¤"</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">"#,##0 %"</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">"#E0"</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">"#,##0.###"</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="4752275256-1">[</span><span class="p" data-group-id="4752275256-2">{</span><span class="s">"1000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4752275256-3">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"0 k ¤"</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">"0 k ¤"</span><span class="p" data-group-id="4752275256-3">]</span><span class="p" data-group-id="4752275256-2">}</span><span class="p">,</span><span class="w">
|
||
</span><span class="p" data-group-id="4752275256-4">{</span><span class="s">"10000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4752275256-5">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"00 k ¤"</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">"00 k ¤"</span><span class="p" data-group-id="4752275256-5">]</span><span class="p" data-group-id="4752275256-4">}</span><span class="p">,</span><span class="w">
|
||
</span><span class="p" data-group-id="4752275256-6">{</span><span class="s">"100000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4752275256-7">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"000 k ¤"</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">"000 k ¤"</span><span class="p" data-group-id="4752275256-7">]</span><span class="p" data-group-id="4752275256-6">}</span><span class="p">,</span><span class="w">
|
||
</span><span class="p" data-group-id="4752275256-8">{</span><span class="s">"1000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4752275256-9">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"0 M ¤"</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">"0 M ¤"</span><span class="p" data-group-id="4752275256-9">]</span><span class="p" data-group-id="4752275256-8">}</span><span class="p">,</span><span class="w">
|
||
</span><span class="p" data-group-id="4752275256-10">{</span><span class="s">"10000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4752275256-11">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"00 M ¤"</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">"00 M ¤"</span><span class="p" data-group-id="4752275256-11">]</span><span class="p" data-group-id="4752275256-10">}</span><span class="p">,</span><span class="w">
|
||
</span><span class="p" data-group-id="4752275256-12">{</span><span class="s">"100000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4752275256-13">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"000 M ¤"</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">"000 M ¤"</span><span class="p" data-group-id="4752275256-13">]</span><span class="p" data-group-id="4752275256-12">}</span><span class="p">,</span><span class="w">
|
||
</span><span class="p" data-group-id="4752275256-14">{</span><span class="s">"1000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4752275256-15">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"0 Md ¤"</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">"0 Md ¤"</span><span class="p" data-group-id="4752275256-15">]</span><span class="p" data-group-id="4752275256-14">}</span><span class="p">,</span><span class="w">
|
||
</span><span class="p" data-group-id="4752275256-16">{</span><span class="s">"10000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4752275256-17">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"00 Md ¤"</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">"00 Md ¤"</span><span class="p" data-group-id="4752275256-17">]</span><span class="p" data-group-id="4752275256-16">}</span><span class="p">,</span><span class="w">
|
||
</span><span class="p" data-group-id="4752275256-18">{</span><span class="s">"100000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4752275256-19">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"000 Md ¤"</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">"000 Md ¤"</span><span class="p" data-group-id="4752275256-19">]</span><span class="p" data-group-id="4752275256-18">}</span><span class="p">,</span><span class="w">
|
||
</span><span class="p" data-group-id="4752275256-20">{</span><span class="s">"1000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4752275256-21">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"0 Bn ¤"</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">"0 Bn ¤"</span><span class="p" data-group-id="4752275256-21">]</span><span class="p" data-group-id="4752275256-20">}</span><span class="p">,</span><span class="w">
|
||
</span><span class="p" data-group-id="4752275256-22">{</span><span class="s">"10000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4752275256-23">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"00 Bn ¤"</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">"00 Bn ¤"</span><span class="p" data-group-id="4752275256-23">]</span><span class="p" data-group-id="4752275256-22">}</span><span class="p">,</span><span class="w">
|
||
</span><span class="p" data-group-id="4752275256-24">{</span><span class="s">"100000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4752275256-25">[</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"000 Bn ¤"</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">"000 Bn ¤"</span><span class="p" data-group-id="4752275256-25">]</span><span class="p" data-group-id="4752275256-24">}</span><span class="p" data-group-id="4752275256-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> </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="0750214785-1">(</span><span class="s">"en"</span><span class="p" data-group-id="0750214785-1">)</span><span class="w">
|
||
</span><span class="p" data-group-id="0750214785-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="0750214785-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> </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="7575171141-1">(</span><span class="s">"en"</span><span class="p" data-group-id="7575171141-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>
|