mirror of
https://github.com/plausible/analytics.git
synced 2024-11-23 03:04:43 +03:00
deploy: 3115c6e7a8
This commit is contained in:
parent
2c866ab88e
commit
5d2144835b
5
.build
5
.build
@ -185,6 +185,7 @@ Plausible.Stats.Metrics.html
|
||||
Plausible.Stats.Props.html
|
||||
Plausible.Stats.Query.html
|
||||
Plausible.Stats.Sampling.html
|
||||
Plausible.Stats.TableDecider.html
|
||||
Plausible.Stats.Timeseries.html
|
||||
Plausible.Stats.Util.html
|
||||
Plausible.Stats.html
|
||||
@ -380,8 +381,8 @@ dist/merriweather-latin-ext-300-normal-K6L27CZ5.woff2
|
||||
dist/merriweather-vietnamese-300-italic-EHHNZPUO.woff2
|
||||
dist/merriweather-vietnamese-300-normal-U376L4Z4.woff2
|
||||
dist/remixicon-NKANDIL5.woff2
|
||||
dist/search_data-A7255B9C.js
|
||||
dist/sidebar_items-846FE9F3.js
|
||||
dist/search_data-459534B2.js
|
||||
dist/sidebar_items-91682BD9.js
|
||||
index.html
|
||||
readme.html
|
||||
search.html
|
||||
|
2
404.html
2
404.html
@ -16,7 +16,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -1143,23 +1143,23 @@ pool to disconnect within the given interval.</p><p>See <a href="https://hexdocs
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="9933075815-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="9933075815-1">)</span><span class="w">
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="6530078893-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="6530078893-1">)</span><span class="w">
|
||||
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="9933075815-2">do</span><span class="w">
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="6530078893-2">do</span><span class="w">
|
||||
</span><span class="kn">use</span><span class="w"> </span><span class="nc">Ecto.Schema</span><span class="w">
|
||||
|
||||
</span><span class="na">@primary_key</span><span class="w"> </span><span class="no">false</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="9933075815-3">do</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="6530078893-3">do</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:a</span><span class="p">,</span><span class="w"> </span><span class="nc">Ch</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="s">"UInt64"</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:b</span><span class="p">,</span><span class="w"> </span><span class="ss">:string</span><span class="w">
|
||||
</span><span class="k" data-group-id="9933075815-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="9933075815-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="6530078893-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="6530078893-2">end</span><span class="w">
|
||||
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="9933075815-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="9933075815-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="9933075815-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="9933075815-7">(</span><span class="n">i</span><span class="p" data-group-id="9933075815-7">)</span><span class="p" data-group-id="9933075815-6">}</span><span class="w"> </span><span class="k" data-group-id="9933075815-5">end</span><span class="p" data-group-id="9933075815-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9933075815-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="9933075815-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="9933075815-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="9933075815-9">)</span><span class="w">
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="6530078893-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="6530078893-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="6530078893-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="6530078893-7">(</span><span class="n">i</span><span class="p" data-group-id="6530078893-7">)</span><span class="p" data-group-id="6530078893-6">}</span><span class="w"> </span><span class="k" data-group-id="6530078893-5">end</span><span class="p" data-group-id="6530078893-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6530078893-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="6530078893-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="6530078893-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="6530078893-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="9933075815-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="9933075815-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="9933075815-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9933075815-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="9933075815-13">(</span><span class="p" data-group-id="9933075815-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="9933075815-12">]</span><span class="p" data-group-id="9933075815-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="6530078893-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="6530078893-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="6530078893-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6530078893-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="6530078893-13">(</span><span class="p" data-group-id="6530078893-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="6530078893-12">]</span><span class="p" data-group-id="6530078893-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -727,12 +727,12 @@ this user owns + StatsAPI if the user has a configured Stats API key.</p><p>Give
|
||||
|
||||
<p>Queries the ClickHouse database for the monthly pageview usage. If the given user's
|
||||
subscription is <code class="inline">active</code>, <code class="inline">past_due</code>, or a <code class="inline">deleted</code> (but not yet expired), a map
|
||||
with the following structure is returned:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="7846877064-1">%{</span><span class="w">
|
||||
</span><span class="ss">current_cycle</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="7846877064-2">(</span><span class="p" data-group-id="7846877064-2">)</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">last_cycle</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="7846877064-3">(</span><span class="p" data-group-id="7846877064-3">)</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">penultimate_cycle</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="7846877064-4">(</span><span class="p" data-group-id="7846877064-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7846877064-1">}</span></code></pre><p>In all other cases of the subscription status (or a <code class="inline">free_10k</code> subscription which
|
||||
does not have a <code class="inline">last_bill_date</code> defined) - the following structure is returned:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="8174052100-1">%{</span><span class="ss">last_30_days</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="8174052100-2">(</span><span class="p" data-group-id="8174052100-2">)</span><span class="p" data-group-id="8174052100-1">}</span></code></pre><p>Given only a user as input, the usage is queried from across all the sites that the
|
||||
with the following structure is returned:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="3144860941-1">%{</span><span class="w">
|
||||
</span><span class="ss">current_cycle</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="3144860941-2">(</span><span class="p" data-group-id="3144860941-2">)</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">last_cycle</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="3144860941-3">(</span><span class="p" data-group-id="3144860941-3">)</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">penultimate_cycle</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="3144860941-4">(</span><span class="p" data-group-id="3144860941-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3144860941-1">}</span></code></pre><p>In all other cases of the subscription status (or a <code class="inline">free_10k</code> subscription which
|
||||
does not have a <code class="inline">last_bill_date</code> defined) - the following structure is returned:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="6309450783-1">%{</span><span class="ss">last_30_days</span><span class="p">:</span><span class="w"> </span><span class="n">usage_cycle</span><span class="p" data-group-id="6309450783-2">(</span><span class="p" data-group-id="6309450783-2">)</span><span class="p" data-group-id="6309450783-1">}</span></code></pre><p>Given only a user as input, the usage is queried from across all the sites that the
|
||||
user owns. Alternatively, given an optional argument of <code class="inline">site_ids</code>, the usage from
|
||||
across all those sites is queried instead.</p>
|
||||
</section>
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -148,7 +148,7 @@ Pages
|
||||
the set of natural languages that are preferred as a response to the request.
|
||||
Language tags function are provided in <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code class="inline">Cldr.LanguageTag</code></a>.</p><p>The format of an <code class="inline">Accept-Language</code> header is as follows in <code class="inline">ABNF</code> format:</p><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="nc">Accept</span><span class="o">-</span><span class="nc">Language</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">"Accept-Language"</span><span class="w"> </span><span class="s">":"</span><span class="w">
|
||||
</span><span class="mi">1</span><span class="c1">#( language-range [ ";" "q" "=" qvalue ] )</span><span class="w">
|
||||
</span><span class="n">language</span><span class="o">-</span><span class="n">range</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p" data-group-id="7683498138-1">(</span><span class="w"> </span><span class="p" data-group-id="7683498138-2">(</span><span class="w"> </span><span class="mi">1</span><span class="o">*</span><span class="mi">8</span><span class="nc">ALPHA</span><span class="w"> </span><span class="o">*</span><span class="p" data-group-id="7683498138-3">(</span><span class="w"> </span><span class="s">"-"</span><span class="w"> </span><span class="mi">1</span><span class="o">*</span><span class="mi">8</span><span class="nc">ALPHA</span><span class="w"> </span><span class="p" data-group-id="7683498138-3">)</span><span class="w"> </span><span class="p" data-group-id="7683498138-2">)</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="s">"*"</span><span class="w"> </span><span class="p" data-group-id="7683498138-1">)</span></code></pre><p>Each language-range MAY be given an associated quality value which represents an
|
||||
</span><span class="n">language</span><span class="o">-</span><span class="n">range</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p" data-group-id="2320422388-1">(</span><span class="w"> </span><span class="p" data-group-id="2320422388-2">(</span><span class="w"> </span><span class="mi">1</span><span class="o">*</span><span class="mi">8</span><span class="nc">ALPHA</span><span class="w"> </span><span class="o">*</span><span class="p" data-group-id="2320422388-3">(</span><span class="w"> </span><span class="s">"-"</span><span class="w"> </span><span class="mi">1</span><span class="o">*</span><span class="mi">8</span><span class="nc">ALPHA</span><span class="w"> </span><span class="p" data-group-id="2320422388-3">)</span><span class="w"> </span><span class="p" data-group-id="2320422388-2">)</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="s">"*"</span><span class="w"> </span><span class="p" data-group-id="2320422388-1">)</span></code></pre><p>Each language-range MAY be given an associated quality value which represents an
|
||||
estimate of the user's preference for the languages specified by that range. The
|
||||
quality value defaults to "q=1". For example,</p><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="nc">Accept</span><span class="o">-</span><span class="ss">Language</span><span class="p">:</span><span class="w"> </span><span class="n">da</span><span class="p">,</span><span class="w"> </span><span class="n">en</span><span class="o">-</span><span class="n">gb</span><span class="p">;</span><span class="n">q</span><span class="o">=</span><span class="mf">0.8</span><span class="p">,</span><span class="w"> </span><span class="n">en</span><span class="p">;</span><span class="n">q</span><span class="o">=</span><span class="mf">0.7</span></code></pre><p>would mean: "I prefer Danish, but will accept British English and other types of English."</p>
|
||||
</section>
|
||||
@ -261,54 +261,54 @@ a configured <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.html"><code class="
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="8798371360-1">(</span><span class="s">"da;q=0.1,zh-TW;q=0.3"</span><span class="p">,</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p" data-group-id="8798371360-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8798371360-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8798371360-3">%</span><span class="nc" data-group-id="8798371360-3">Cldr.LanguageTag</span><span class="p" data-group-id="8798371360-3">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="0022152380-1">(</span><span class="s">"da;q=0.1,zh-TW;q=0.3"</span><span class="p">,</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p" data-group-id="0022152380-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0022152380-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0022152380-3">%</span><span class="nc" data-group-id="0022152380-3">Cldr.LanguageTag</span><span class="p" data-group-id="0022152380-3">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8798371360-4">[</span><span class="p" data-group-id="8798371360-4">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8798371360-5">%{</span><span class="p" data-group-id="8798371360-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0022152380-4">[</span><span class="p" data-group-id="0022152380-4">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0022152380-5">%{</span><span class="p" data-group-id="0022152380-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8798371360-6">%{</span><span class="p" data-group-id="8798371360-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8798371360-7">[</span><span class="p" data-group-id="8798371360-7">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0022152380-6">%{</span><span class="p" data-group-id="0022152380-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0022152380-7">[</span><span class="p" data-group-id="0022152380-7">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Hant</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:TW</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8798371360-8">%{</span><span class="p" data-group-id="8798371360-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8798371360-9">[</span><span class="p" data-group-id="8798371360-9">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8798371360-3">}</span><span class="p" data-group-id="8798371360-2">}</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0022152380-8">%{</span><span class="p" data-group-id="0022152380-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0022152380-9">[</span><span class="p" data-group-id="0022152380-9">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="0022152380-3">}</span><span class="p" data-group-id="0022152380-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="8798371360-10">(</span><span class="s">"da;q=0.1,zh-TW;q=0.3"</span><span class="p">,</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p" data-group-id="8798371360-10">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8798371360-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8798371360-12">%</span><span class="nc" data-group-id="8798371360-12">Cldr.LanguageTag</span><span class="p" data-group-id="8798371360-12">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="0022152380-10">(</span><span class="s">"da;q=0.1,zh-TW;q=0.3"</span><span class="p">,</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p" data-group-id="0022152380-10">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0022152380-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0022152380-12">%</span><span class="nc" data-group-id="0022152380-12">Cldr.LanguageTag</span><span class="p" data-group-id="0022152380-12">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8798371360-13">[</span><span class="p" data-group-id="8798371360-13">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8798371360-14">%{</span><span class="p" data-group-id="8798371360-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0022152380-13">[</span><span class="p" data-group-id="0022152380-13">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0022152380-14">%{</span><span class="p" data-group-id="0022152380-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8798371360-15">%{</span><span class="p" data-group-id="8798371360-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8798371360-16">[</span><span class="p" data-group-id="8798371360-16">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0022152380-15">%{</span><span class="p" data-group-id="0022152380-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0022152380-16">[</span><span class="p" data-group-id="0022152380-16">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Hant</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:TW</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8798371360-17">%{</span><span class="p" data-group-id="8798371360-17">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8798371360-18">[</span><span class="p" data-group-id="8798371360-18">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8798371360-12">}</span><span class="p" data-group-id="8798371360-11">}</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0022152380-17">%{</span><span class="p" data-group-id="0022152380-17">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0022152380-18">[</span><span class="p" data-group-id="0022152380-18">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="0022152380-12">}</span><span class="p" data-group-id="0022152380-11">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="8798371360-19">(</span><span class="s">"xx,yy;q=0.3"</span><span class="p" data-group-id="8798371360-19">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8798371360-20">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8798371360-21">{</span><span class="nc">Cldr.NoMatchingLocale</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"No configured locale could be matched to </span><span class="se">\"</span><span class="s">xx,yy;q=0.3</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="8798371360-21">}</span><span class="p" data-group-id="8798371360-20">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="0022152380-19">(</span><span class="s">"xx,yy;q=0.3"</span><span class="p" data-group-id="0022152380-19">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0022152380-20">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0022152380-21">{</span><span class="nc">Cldr.NoMatchingLocale</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"No configured locale could be matched to </span><span class="se">\"</span><span class="s">xx,yy;q=0.3</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="0022152380-21">}</span><span class="p" data-group-id="0022152380-20">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="8798371360-22">(</span><span class="s">"invalid_tag"</span><span class="p" data-group-id="8798371360-22">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8798371360-23">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8798371360-24">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="8798371360-24">}</span><span class="p" data-group-id="8798371360-23">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">best_match</span><span class="p" data-group-id="0022152380-22">(</span><span class="s">"invalid_tag"</span><span class="p" data-group-id="0022152380-22">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0022152380-23">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0022152380-24">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="0022152380-24">}</span><span class="p" data-group-id="0022152380-23">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="parse/1">
|
||||
@ -369,95 +369,95 @@ wuth an error tuple for each invalid tag added at the end of the list.</p><h2 id
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="8826188699-1">(</span><span class="s">"da,zh-TW;q=0.3"</span><span class="p">,</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p" data-group-id="8826188699-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-3">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-4">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-5">%</span><span class="nc" data-group-id="8826188699-5">Cldr.LanguageTag</span><span class="p" data-group-id="8826188699-5">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="2179275585-1">(</span><span class="s">"da,zh-TW;q=0.3"</span><span class="p">,</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p" data-group-id="2179275585-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-3">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-4">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-5">%</span><span class="nc" data-group-id="2179275585-5">Cldr.LanguageTag</span><span class="p" data-group-id="2179275585-5">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-6">[</span><span class="p" data-group-id="8826188699-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-7">%{</span><span class="p" data-group-id="8826188699-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-6">[</span><span class="p" data-group-id="2179275585-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-7">%{</span><span class="p" data-group-id="2179275585-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-8">%{</span><span class="p" data-group-id="8826188699-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-9">[</span><span class="p" data-group-id="8826188699-9">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-8">%{</span><span class="p" data-group-id="2179275585-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-9">[</span><span class="p" data-group-id="2179275585-9">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:DK</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-10">%{</span><span class="p" data-group-id="8826188699-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-11">[</span><span class="p" data-group-id="8826188699-11">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-5">}</span><span class="p" data-group-id="8826188699-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-12">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-13">%</span><span class="nc" data-group-id="8826188699-13">Cldr.LanguageTag</span><span class="p" data-group-id="8826188699-13">{</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-10">%{</span><span class="p" data-group-id="2179275585-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-11">[</span><span class="p" data-group-id="2179275585-11">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-5">}</span><span class="p" data-group-id="2179275585-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-12">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-13">%</span><span class="nc" data-group-id="2179275585-13">Cldr.LanguageTag</span><span class="p" data-group-id="2179275585-13">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-14">[</span><span class="p" data-group-id="8826188699-14">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-15">%{</span><span class="p" data-group-id="8826188699-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-14">[</span><span class="p" data-group-id="2179275585-14">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-15">%{</span><span class="p" data-group-id="2179275585-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-16">%{</span><span class="p" data-group-id="8826188699-16">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-17">[</span><span class="p" data-group-id="8826188699-17">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-16">%{</span><span class="p" data-group-id="2179275585-16">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-17">[</span><span class="p" data-group-id="2179275585-17">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Hant</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:TW</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-18">%{</span><span class="p" data-group-id="8826188699-18">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-19">[</span><span class="p" data-group-id="8826188699-19">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-13">}</span><span class="p" data-group-id="8826188699-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-3">]</span><span class="p" data-group-id="8826188699-2">}</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-18">%{</span><span class="p" data-group-id="2179275585-18">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-19">[</span><span class="p" data-group-id="2179275585-19">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-13">}</span><span class="p" data-group-id="2179275585-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-3">]</span><span class="p" data-group-id="2179275585-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="8826188699-20">(</span><span class="s">"invalid_tag"</span><span class="p" data-group-id="8826188699-20">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-21">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-22">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="8826188699-22">}</span><span class="p" data-group-id="8826188699-21">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="2179275585-20">(</span><span class="s">"invalid_tag"</span><span class="p" data-group-id="2179275585-20">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-21">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-22">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="2179275585-22">}</span><span class="p" data-group-id="2179275585-21">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="8826188699-23">(</span><span class="s">"da,zh-TW;q=0.3,invalid_tag"</span><span class="p" data-group-id="8826188699-23">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-24">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-25">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-26">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-27">%</span><span class="nc" data-group-id="8826188699-27">Cldr.LanguageTag</span><span class="p" data-group-id="8826188699-27">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="2179275585-23">(</span><span class="s">"da,zh-TW;q=0.3,invalid_tag"</span><span class="p" data-group-id="2179275585-23">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-24">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-25">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-26">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-27">%</span><span class="nc" data-group-id="2179275585-27">Cldr.LanguageTag</span><span class="p" data-group-id="2179275585-27">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-28">[</span><span class="p" data-group-id="8826188699-28">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-29">%{</span><span class="p" data-group-id="8826188699-29">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-28">[</span><span class="p" data-group-id="2179275585-28">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-29">%{</span><span class="p" data-group-id="2179275585-29">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-30">%{</span><span class="p" data-group-id="8826188699-30">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-31">[</span><span class="p" data-group-id="8826188699-31">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-30">%{</span><span class="p" data-group-id="2179275585-30">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-31">[</span><span class="p" data-group-id="2179275585-31">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:DK</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-32">%{</span><span class="p" data-group-id="8826188699-32">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-33">[</span><span class="p" data-group-id="8826188699-33">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-27">}</span><span class="p" data-group-id="8826188699-26">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-34">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-35">%</span><span class="nc" data-group-id="8826188699-35">Cldr.LanguageTag</span><span class="p" data-group-id="8826188699-35">{</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-32">%{</span><span class="p" data-group-id="2179275585-32">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-33">[</span><span class="p" data-group-id="2179275585-33">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-27">}</span><span class="p" data-group-id="2179275585-26">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-34">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-35">%</span><span class="nc" data-group-id="2179275585-35">Cldr.LanguageTag</span><span class="p" data-group-id="2179275585-35">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-36">[</span><span class="p" data-group-id="8826188699-36">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-37">%{</span><span class="p" data-group-id="8826188699-37">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-36">[</span><span class="p" data-group-id="2179275585-36">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-37">%{</span><span class="p" data-group-id="2179275585-37">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-38">%{</span><span class="p" data-group-id="8826188699-38">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-39">[</span><span class="p" data-group-id="8826188699-39">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-38">%{</span><span class="p" data-group-id="2179275585-38">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-39">[</span><span class="p" data-group-id="2179275585-39">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Hant</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:TW</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-40">%{</span><span class="p" data-group-id="8826188699-40">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8826188699-41">[</span><span class="p" data-group-id="8826188699-41">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-35">}</span><span class="p" data-group-id="8826188699-34">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-42">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-43">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="8826188699-43">}</span><span class="p" data-group-id="8826188699-42">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8826188699-25">]</span><span class="p" data-group-id="8826188699-24">}</span></code></pre>
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-40">%{</span><span class="p" data-group-id="2179275585-40">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2179275585-41">[</span><span class="p" data-group-id="2179275585-41">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-35">}</span><span class="p" data-group-id="2179275585-34">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-42">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-43">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="2179275585-43">}</span><span class="p" data-group-id="2179275585-42">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="2179275585-25">]</span><span class="p" data-group-id="2179275585-24">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="parse!/1">
|
||||
@ -502,92 +502,92 @@ wuth an error tuple for each invalid tag added at the end of the list.</p><h2 id
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse!</span><span class="p" data-group-id="4807216434-1">(</span><span class="s">"da,zh-TW;q=0.3"</span><span class="p" data-group-id="4807216434-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-2">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-3">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-4">%</span><span class="nc" data-group-id="4807216434-4">Cldr.LanguageTag</span><span class="p" data-group-id="4807216434-4">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse!</span><span class="p" data-group-id="9619257978-1">(</span><span class="s">"da,zh-TW;q=0.3"</span><span class="p" data-group-id="9619257978-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-2">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-3">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-4">%</span><span class="nc" data-group-id="9619257978-4">Cldr.LanguageTag</span><span class="p" data-group-id="9619257978-4">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-5">[</span><span class="p" data-group-id="4807216434-5">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-6">%{</span><span class="p" data-group-id="4807216434-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-5">[</span><span class="p" data-group-id="9619257978-5">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-6">%{</span><span class="p" data-group-id="9619257978-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-7">%{</span><span class="p" data-group-id="4807216434-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-8">[</span><span class="p" data-group-id="4807216434-8">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-7">%{</span><span class="p" data-group-id="9619257978-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-8">[</span><span class="p" data-group-id="9619257978-8">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:DK</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-9">%{</span><span class="p" data-group-id="4807216434-9">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-10">[</span><span class="p" data-group-id="4807216434-10">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-4">}</span><span class="p" data-group-id="4807216434-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-11">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-12">%</span><span class="nc" data-group-id="4807216434-12">Cldr.LanguageTag</span><span class="p" data-group-id="4807216434-12">{</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-9">%{</span><span class="p" data-group-id="9619257978-9">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-10">[</span><span class="p" data-group-id="9619257978-10">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-4">}</span><span class="p" data-group-id="9619257978-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-11">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-12">%</span><span class="nc" data-group-id="9619257978-12">Cldr.LanguageTag</span><span class="p" data-group-id="9619257978-12">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-13">[</span><span class="p" data-group-id="4807216434-13">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-14">%{</span><span class="p" data-group-id="4807216434-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-13">[</span><span class="p" data-group-id="9619257978-13">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-14">%{</span><span class="p" data-group-id="9619257978-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-15">%{</span><span class="p" data-group-id="4807216434-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-16">[</span><span class="p" data-group-id="4807216434-16">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-15">%{</span><span class="p" data-group-id="9619257978-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-16">[</span><span class="p" data-group-id="9619257978-16">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Hant</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:TW</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-17">%{</span><span class="p" data-group-id="4807216434-17">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-18">[</span><span class="p" data-group-id="4807216434-18">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-12">}</span><span class="p" data-group-id="4807216434-11">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-2">]</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-17">%{</span><span class="p" data-group-id="9619257978-17">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-18">[</span><span class="p" data-group-id="9619257978-18">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-12">}</span><span class="p" data-group-id="9619257978-11">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-2">]</span><span class="w">
|
||||
|
||||
</span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse!</span><span class="w"> </span><span class="s">"invalid_tag"</span><span class="w">
|
||||
</span><span class="gt">** (Cldr.AcceptLanguageError) "Expected a BCP47 language tag. Could not parse the remaining "g" starting at position 11
|
||||
(ex_cldr) lib/cldr/accept_language.ex:304: Cldr.AcceptLanguage.parse!/1</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse!</span><span class="p" data-group-id="4807216434-19">(</span><span class="s">"da,zh-TW;q=0.3,invalid_tag"</span><span class="p" data-group-id="4807216434-19">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-20">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-21">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-22">%</span><span class="nc" data-group-id="4807216434-22">Cldr.LanguageTag</span><span class="p" data-group-id="4807216434-22">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.AcceptLanguage</span><span class="o">.</span><span class="n">parse!</span><span class="p" data-group-id="9619257978-19">(</span><span class="s">"da,zh-TW;q=0.3,invalid_tag"</span><span class="p" data-group-id="9619257978-19">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-20">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-21">{</span><span class="mf">1.0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-22">%</span><span class="nc" data-group-id="9619257978-22">Cldr.LanguageTag</span><span class="p" data-group-id="9619257978-22">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-23">[</span><span class="p" data-group-id="4807216434-23">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-24">%{</span><span class="p" data-group-id="4807216434-24">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-23">[</span><span class="p" data-group-id="9619257978-23">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-24">%{</span><span class="p" data-group-id="9619257978-24">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-25">%{</span><span class="p" data-group-id="4807216434-25">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-26">[</span><span class="p" data-group-id="4807216434-26">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-25">%{</span><span class="p" data-group-id="9619257978-25">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-26">[</span><span class="p" data-group-id="9619257978-26">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:da</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"da"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:DK</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-27">%{</span><span class="p" data-group-id="4807216434-27">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-28">[</span><span class="p" data-group-id="4807216434-28">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-22">}</span><span class="p" data-group-id="4807216434-21">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-29">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-30">%</span><span class="nc" data-group-id="4807216434-30">Cldr.LanguageTag</span><span class="p" data-group-id="4807216434-30">{</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-27">%{</span><span class="p" data-group-id="9619257978-27">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-28">[</span><span class="p" data-group-id="9619257978-28">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-22">}</span><span class="p" data-group-id="9619257978-21">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-29">{</span><span class="mf">0.3</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-30">%</span><span class="nc" data-group-id="9619257978-30">Cldr.LanguageTag</span><span class="p" data-group-id="9619257978-30">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">TestBackend.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-31">[</span><span class="p" data-group-id="4807216434-31">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-32">%{</span><span class="p" data-group-id="4807216434-32">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-31">[</span><span class="p" data-group-id="9619257978-31">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-32">%{</span><span class="p" data-group-id="9619257978-32">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-33">%{</span><span class="p" data-group-id="4807216434-33">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-34">[</span><span class="p" data-group-id="4807216434-34">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-33">%{</span><span class="p" data-group-id="9619257978-33">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-34">[</span><span class="p" data-group-id="9619257978-34">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"zh-Hant"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"zh-TW"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Hant</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:TW</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-35">%{</span><span class="p" data-group-id="4807216434-35">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4807216434-36">[</span><span class="p" data-group-id="4807216434-36">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-30">}</span><span class="p" data-group-id="4807216434-29">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-37">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-38">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="4807216434-38">}</span><span class="p" data-group-id="4807216434-37">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4807216434-20">]</span></code></pre>
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-35">%{</span><span class="p" data-group-id="9619257978-35">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9619257978-36">[</span><span class="p" data-group-id="9619257978-36">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-30">}</span><span class="p" data-group-id="9619257978-29">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-37">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-38">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">g</span><span class="se">\"</span><span class="s"> starting at position 11"</span><span class="p" data-group-id="9619257978-38">}</span><span class="p" data-group-id="9619257978-37">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9619257978-20">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -419,11 +419,11 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</h2>
|
||||
<p> MyApp.Cldr.Currency.currencies_for_locale("en")
|
||||
=> {:ok,
|
||||
%{</p><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="ss">FJD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7214446107-1">%</span><span class="nc" data-group-id="7214446107-1">Cldr.Currency</span><span class="p" data-group-id="7214446107-1">{</span><span class="w">
|
||||
%{</p><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="ss">FJD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8112756776-1">%</span><span class="nc" data-group-id="8112756776-1">Cldr.Currency</span><span class="p" data-group-id="8112756776-1">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</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">code</span><span class="p">:</span><span class="w"> </span><span class="s">"FJD"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7214446107-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Fijian dollar"</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">"Fijian dollars"</span><span class="p" data-group-id="7214446107-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8112756776-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Fijian dollar"</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">"Fijian dollars"</span><span class="p" data-group-id="8112756776-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
@ -433,12 +433,12 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"FJD"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="w">
|
||||
</span><span class="p" data-group-id="7214446107-1">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">SUR</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7214446107-3">%</span><span class="nc" data-group-id="7214446107-3">Cldr.Currency</span><span class="p" data-group-id="7214446107-3">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="8112756776-1">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">SUR</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8112756776-3">%</span><span class="nc" data-group-id="8112756776-3">Cldr.Currency</span><span class="p" data-group-id="8112756776-3">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</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">code</span><span class="p">:</span><span class="w"> </span><span class="s">"SUR"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7214446107-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Soviet rouble"</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">"Soviet roubles"</span><span class="p" data-group-id="7214446107-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8112756776-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Soviet rouble"</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">"Soviet roubles"</span><span class="p" data-group-id="8112756776-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
@ -448,7 +448,7 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"SUR"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="w">
|
||||
</span><span class="p" data-group-id="7214446107-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8112756776-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="n">...</span><span class="w">
|
||||
</span><span class="err">}</span><span class="err">}</span></code></pre>
|
||||
</section>
|
||||
@ -499,11 +499,11 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<p> MyApp.Cldr.Currency.currencies_for_locale!("en")
|
||||
=> %{</p><pre><code class="makeup elixir" translate="no"><span class="ss">FJD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0124769380-1">%</span><span class="nc" data-group-id="0124769380-1">Cldr.Currency</span><span class="p" data-group-id="0124769380-1">{</span><span class="w">
|
||||
=> %{</p><pre><code class="makeup elixir" translate="no"><span class="ss">FJD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4588709059-1">%</span><span class="nc" data-group-id="4588709059-1">Cldr.Currency</span><span class="p" data-group-id="4588709059-1">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</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">code</span><span class="p">:</span><span class="w"> </span><span class="s">"FJD"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0124769380-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Fijian dollar"</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">"Fijian dollars"</span><span class="p" data-group-id="0124769380-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4588709059-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Fijian dollar"</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">"Fijian dollars"</span><span class="p" data-group-id="4588709059-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
@ -513,12 +513,12 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"FJD"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="w">
|
||||
</span><span class="p" data-group-id="0124769380-1">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">SUR</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0124769380-3">%</span><span class="nc" data-group-id="0124769380-3">Cldr.Currency</span><span class="p" data-group-id="0124769380-3">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="4588709059-1">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">SUR</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4588709059-3">%</span><span class="nc" data-group-id="4588709059-3">Cldr.Currency</span><span class="p" data-group-id="4588709059-3">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</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">code</span><span class="p">:</span><span class="w"> </span><span class="s">"SUR"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0124769380-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Soviet rouble"</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">"Soviet roubles"</span><span class="p" data-group-id="0124769380-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4588709059-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Soviet rouble"</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">"Soviet roubles"</span><span class="p" data-group-id="4588709059-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
@ -528,7 +528,7 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"SUR"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="w">
|
||||
</span><span class="p" data-group-id="0124769380-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4588709059-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="n">...</span></code></pre><p> }</p>
|
||||
</section>
|
||||
</section>
|
||||
@ -586,13 +586,13 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code</span><span class="p" data-group-id="5848456780-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="5848456780-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5848456780-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5848456780-3">%</span><span class="nc" data-group-id="5848456780-3">Cldr.Currency</span><span class="p" data-group-id="5848456780-3">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code</span><span class="p" data-group-id="2246746912-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="2246746912-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2246746912-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2246746912-3">%</span><span class="nc" data-group-id="2246746912-3">Cldr.Currency</span><span class="p" data-group-id="2246746912-3">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</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">code</span><span class="p">:</span><span class="w"> </span><span class="s">"AUD"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5848456780-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian dollar"</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">"Australian dollars"</span><span class="p" data-group-id="5848456780-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2246746912-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian dollar"</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">"Australian dollars"</span><span class="p" data-group-id="2246746912-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian Dollar"</span><span class="p">,</span><span class="w">
|
||||
@ -600,15 +600,15 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</span><span class="ss">rounding</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">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"A$"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="w">
|
||||
</span><span class="p" data-group-id="5848456780-3">}</span><span class="p" data-group-id="5848456780-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="2246746912-3">}</span><span class="p" data-group-id="2246746912-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code</span><span class="p" data-group-id="5848456780-5">(</span><span class="s">"THB"</span><span class="p" data-group-id="5848456780-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5848456780-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5848456780-7">%</span><span class="nc" data-group-id="5848456780-7">Cldr.Currency</span><span class="p" data-group-id="5848456780-7">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code</span><span class="p" data-group-id="2246746912-5">(</span><span class="s">"THB"</span><span class="p" data-group-id="2246746912-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2246746912-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2246746912-7">%</span><span class="nc" data-group-id="2246746912-7">Cldr.Currency</span><span class="p" data-group-id="2246746912-7">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</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">code</span><span class="p">:</span><span class="w"> </span><span class="s">"THB"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5848456780-8">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai baht"</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">"Thai baht"</span><span class="p" data-group-id="5848456780-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2246746912-8">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai baht"</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">"Thai baht"</span><span class="p" data-group-id="2246746912-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai Baht"</span><span class="p">,</span><span class="w">
|
||||
@ -616,7 +616,7 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</span><span class="ss">rounding</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">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"THB"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="w">
|
||||
</span><span class="p" data-group-id="5848456780-7">}</span><span class="p" data-group-id="5848456780-6">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="2246746912-7">}</span><span class="p" data-group-id="2246746912-6">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="currency_for_code!/2">
|
||||
@ -675,12 +675,12 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code!</span><span class="p" data-group-id="1696585535-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="1696585535-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1696585535-2">%</span><span class="nc" data-group-id="1696585535-2">Cldr.Currency</span><span class="p" data-group-id="1696585535-2">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code!</span><span class="p" data-group-id="2772829590-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="2772829590-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2772829590-2">%</span><span class="nc" data-group-id="2772829590-2">Cldr.Currency</span><span class="p" data-group-id="2772829590-2">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</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">code</span><span class="p">:</span><span class="w"> </span><span class="s">"AUD"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="1696585535-3">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian dollar"</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">"Australian dollars"</span><span class="p" data-group-id="1696585535-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2772829590-3">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian dollar"</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">"Australian dollars"</span><span class="p" data-group-id="2772829590-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Australian Dollar"</span><span class="p">,</span><span class="w">
|
||||
@ -688,14 +688,14 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</span><span class="ss">rounding</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">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"A$"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="w">
|
||||
</span><span class="p" data-group-id="1696585535-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="2772829590-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code!</span><span class="p" data-group-id="1696585535-4">(</span><span class="s">"THB"</span><span class="p" data-group-id="1696585535-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1696585535-5">%</span><span class="nc" data-group-id="1696585535-5">Cldr.Currency</span><span class="p" data-group-id="1696585535-5">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_for_code!</span><span class="p" data-group-id="2772829590-4">(</span><span class="s">"THB"</span><span class="p" data-group-id="2772829590-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2772829590-5">%</span><span class="nc" data-group-id="2772829590-5">Cldr.Currency</span><span class="p" data-group-id="2772829590-5">{</span><span class="w">
|
||||
</span><span class="ss">cash_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_rounding</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">code</span><span class="p">:</span><span class="w"> </span><span class="s">"THB"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="1696585535-6">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai baht"</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">"Thai baht"</span><span class="p" data-group-id="1696585535-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2772829590-6">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai baht"</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">"Thai baht"</span><span class="p" data-group-id="2772829590-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Thai Baht"</span><span class="p">,</span><span class="w">
|
||||
@ -703,7 +703,7 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</span><span class="ss">rounding</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">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"THB"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="w">
|
||||
</span><span class="p" data-group-id="1696585535-5">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="2772829590-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="currency_from_locale/1">
|
||||
@ -744,15 +744,15 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="p" data-group-id="2627964524-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">locale</span><span class="p" data-group-id="2627964524-1">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="2627964524-2">(</span><span class="s">"en"</span><span class="p" data-group-id="2627964524-2">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="p" data-group-id="9014772481-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">locale</span><span class="p" data-group-id="9014772481-1">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="9014772481-2">(</span><span class="s">"en"</span><span class="p" data-group-id="9014772481-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_from_locale</span><span class="w"> </span><span class="n">locale</span><span class="w">
|
||||
</span><span class="ss">:USD</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="p" data-group-id="2627964524-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">locale</span><span class="p" data-group-id="2627964524-3">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="2627964524-4">(</span><span class="s">"en-AU"</span><span class="p" data-group-id="2627964524-4">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="p" data-group-id="9014772481-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">locale</span><span class="p" data-group-id="9014772481-3">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="9014772481-4">(</span><span class="s">"en-AU"</span><span class="p" data-group-id="9014772481-4">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_from_locale</span><span class="w"> </span><span class="n">locale</span><span class="w">
|
||||
</span><span class="ss">:AUD</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_from_locale</span><span class="p" data-group-id="2627964524-5">(</span><span class="s">"en-GB"</span><span class="p" data-group-id="2627964524-5">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">currency_from_locale</span><span class="p" data-group-id="9014772481-5">(</span><span class="s">"en-GB"</span><span class="p" data-group-id="9014772481-5">)</span><span class="w">
|
||||
</span><span class="ss">:GBP</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -796,14 +796,14 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">currency_history_for_locale</span><span class="p" data-group-id="0395127394-1">(</span><span class="s">"en"</span><span class="p" data-group-id="0395127394-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0395127394-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0395127394-3">%{</span><span class="w">
|
||||
</span><span class="ss">USD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0395127394-4">%{</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="ld">~D[1792-01-01]</span><span class="p">,</span><span class="w"> </span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="0395127394-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">USN</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0395127394-5">%{</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">false</span><span class="p" data-group-id="0395127394-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">USS</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0395127394-6">%{</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w"> </span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">false</span><span class="p">,</span><span class="w"> </span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="ld">~D[2014-03-01]</span><span class="p" data-group-id="0395127394-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0395127394-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0395127394-2">}</span></code></pre>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">currency_history_for_locale</span><span class="p" data-group-id="5925813800-1">(</span><span class="s">"en"</span><span class="p" data-group-id="5925813800-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5925813800-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5925813800-3">%{</span><span class="w">
|
||||
</span><span class="ss">USD</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5925813800-4">%{</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="ld">~D[1792-01-01]</span><span class="p">,</span><span class="w"> </span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="5925813800-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">USN</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5925813800-5">%{</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">false</span><span class="p" data-group-id="5925813800-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">USS</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5925813800-6">%{</span><span class="ss">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w"> </span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">false</span><span class="p">,</span><span class="w"> </span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="ld">~D[2014-03-01]</span><span class="p" data-group-id="5925813800-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5925813800-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5925813800-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="currency_strings/3">
|
||||
@ -862,9 +862,9 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">currency_strings</span><span class="p" data-group-id="5834765746-1">(</span><span class="s">"en"</span><span class="p" data-group-id="5834765746-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="5834765746-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5834765746-3">%{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">currency_strings</span><span class="p" data-group-id="0207888836-1">(</span><span class="s">"en"</span><span class="p" data-group-id="0207888836-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="0207888836-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0207888836-3">%{</span><span class="w">
|
||||
</span><span class="s">"mexican silver pesos"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:MXP</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"sudanese dinar"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:SDD</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"bad"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:BAD</span><span class="p">,</span><span class="w">
|
||||
@ -874,7 +874,7 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</span><span class="s">"guyanaese dollars"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:GYD</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"equatorial guinean ekwele"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:GQE</span><span class="p">,</span><span class="w">
|
||||
</span><span class="n">...</span><span class="w">
|
||||
</span><span class="p" data-group-id="5834765746-3">}</span><span class="p" data-group-id="5834765746-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="0207888836-3">}</span><span class="p" data-group-id="0207888836-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="currency_strings!/3">
|
||||
@ -933,8 +933,8 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">currency_strings!</span><span class="p" data-group-id="8157760710-1">(</span><span class="s">"en"</span><span class="p" data-group-id="8157760710-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="8157760710-2">%{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">currency_strings!</span><span class="p" data-group-id="4505925143-1">(</span><span class="s">"en"</span><span class="p" data-group-id="4505925143-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4505925143-2">%{</span><span class="w">
|
||||
</span><span class="s">"mexican silver pesos"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:MXP</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"sudanese dinar"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:SDD</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"bad"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:BAD</span><span class="p">,</span><span class="w">
|
||||
@ -944,7 +944,7 @@ The default is <code class="inline">:all</code>. See <a href="https://hexdocs.pm
|
||||
</span><span class="s">"guyanaese dollars"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:GYD</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"equatorial guinean ekwele"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="ss">:GQE</span><span class="p">,</span><span class="w">
|
||||
</span><span class="n">...</span><span class="w">
|
||||
</span><span class="p" data-group-id="8157760710-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="4505925143-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="current_currency_from_locale/1">
|
||||
@ -982,10 +982,10 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">current_currency_from_locale</span><span class="p" data-group-id="0085754373-1">(</span><span class="s">"en"</span><span class="p" data-group-id="0085754373-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">current_currency_from_locale</span><span class="p" data-group-id="4831340287-1">(</span><span class="s">"en"</span><span class="p" data-group-id="4831340287-1">)</span><span class="w">
|
||||
</span><span class="ss">:USD</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">current_currency_from_locale</span><span class="p" data-group-id="0085754373-2">(</span><span class="s">"en-AU"</span><span class="p" data-group-id="0085754373-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">current_currency_from_locale</span><span class="p" data-group-id="4831340287-2">(</span><span class="s">"en-AU"</span><span class="p" data-group-id="4831340287-2">)</span><span class="w">
|
||||
</span><span class="ss">:AUD</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1033,7 +1033,7 @@ mapping is returned for that territory.</p><h2 id="current_territory_currencies/
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">current_territory_currencies</span><span class="p" data-group-id="5324387136-1">(</span><span class="p" data-group-id="5324387136-1">)</span></code></pre>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">current_territory_currencies</span><span class="p" data-group-id="2697234764-1">(</span><span class="p" data-group-id="2697234764-1">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="known_currencies/0">
|
||||
@ -1125,11 +1125,11 @@ currency code</li></ul><h2 id="known_currency_code/1-returns" class="section-hea
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_code</span><span class="p" data-group-id="2507058105-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="2507058105-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2507058105-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:AUD</span><span class="p" data-group-id="2507058105-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_code</span><span class="p" data-group-id="0338517008-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="0338517008-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0338517008-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:AUD</span><span class="p" data-group-id="0338517008-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_code</span><span class="p" data-group-id="2507058105-3">(</span><span class="s">"GGG"</span><span class="p" data-group-id="2507058105-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2507058105-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2507058105-5">{</span><span class="nc">Cldr.UnknownCurrencyError</span><span class="p">,</span><span class="w"> </span><span class="s">"The currency </span><span class="se">\"</span><span class="s">GGG</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="2507058105-5">}</span><span class="p" data-group-id="2507058105-4">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_code</span><span class="p" data-group-id="0338517008-3">(</span><span class="s">"GGG"</span><span class="p" data-group-id="0338517008-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0338517008-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0338517008-5">{</span><span class="nc">Cldr.UnknownCurrencyError</span><span class="p">,</span><span class="w"> </span><span class="s">"The currency </span><span class="se">\"</span><span class="s">GGG</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="0338517008-5">}</span><span class="p" data-group-id="0338517008-4">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="known_currency_code?/1">
|
||||
@ -1176,13 +1176,13 @@ currency code</li></ul><h2 id="known_currency_code?/1-returns" class="section-he
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_code?</span><span class="p" data-group-id="6618474913-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="6618474913-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_code?</span><span class="p" data-group-id="0268676630-1">(</span><span class="s">"AUD"</span><span class="p" data-group-id="0268676630-1">)</span><span class="w">
|
||||
</span><span class="no">true</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_code?</span><span class="p" data-group-id="6618474913-2">(</span><span class="s">"GGG"</span><span class="p" data-group-id="6618474913-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_code?</span><span class="p" data-group-id="0268676630-2">(</span><span class="s">"GGG"</span><span class="p" data-group-id="0268676630-2">)</span><span class="w">
|
||||
</span><span class="no">false</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_code?</span><span class="p" data-group-id="6618474913-3">(</span><span class="ss">:XCV</span><span class="p" data-group-id="6618474913-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_code?</span><span class="p" data-group-id="0268676630-3">(</span><span class="ss">:XCV</span><span class="p" data-group-id="0268676630-3">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1217,7 +1217,7 @@ currency code</li></ul><h2 id="known_currency_code?/1-returns" class="section-he
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_codes</span><span class="p" data-group-id="6791944299-1">(</span><span class="p" data-group-id="6791944299-1">)</span></code></pre>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">known_currency_codes</span><span class="p" data-group-id="7538206377-1">(</span><span class="p" data-group-id="7538206377-1">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="new/2">
|
||||
@ -1276,14 +1276,14 @@ such as <code class="inline">0.05</code>. Optional.</li></ul><h2 id="new/2-retur
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="5156322453-1">(</span><span class="ss">:XAE</span><span class="p">,</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Custom Name"</span><span class="p">,</span><span class="w"> </span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="5156322453-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5156322453-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5156322453-3">%</span><span class="nc" data-group-id="5156322453-3">Cldr.Currency</span><span class="p" data-group-id="5156322453-3">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="4278454803-1">(</span><span class="ss">:XAE</span><span class="p">,</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Custom Name"</span><span class="p">,</span><span class="w"> </span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="4278454803-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4278454803-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4278454803-3">%</span><span class="nc" data-group-id="4278454803-3">Cldr.Currency</span><span class="p" data-group-id="4278454803-3">{</span><span class="w">
|
||||
</span><span class="ss">alt_code</span><span class="p">:</span><span class="w"> </span><span class="ss">:XAE</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cash_digits</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">cash_rounding</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">code</span><span class="p">:</span><span class="w"> </span><span class="ss">:XAE</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5156322453-4">%{</span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Custom Name"</span><span class="p" data-group-id="5156322453-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">count</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4278454803-4">%{</span><span class="ss">other</span><span class="p">:</span><span class="w"> </span><span class="s">"Custom Name"</span><span class="p" data-group-id="4278454803-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">digits</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">from</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">iso_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
@ -1293,11 +1293,11 @@ such as <code class="inline">0.05</code>. Optional.</li></ul><h2 id="new/2-retur
|
||||
</span><span class="ss">symbol</span><span class="p">:</span><span class="w"> </span><span class="s">"XAE"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">tender</span><span class="p">:</span><span class="w"> </span><span class="no">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">to</span><span class="p">:</span><span class="w"> </span><span class="no">nil</span><span class="w">
|
||||
</span><span class="p" data-group-id="5156322453-3">}</span><span class="p" data-group-id="5156322453-2">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="5156322453-5">(</span><span class="ss">:XAH</span><span class="p">,</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Custom Name"</span><span class="p" data-group-id="5156322453-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5156322453-6">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="s">"Required options are missing. Required options are [:name, :digits]"</span><span class="p" data-group-id="5156322453-6">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="5156322453-7">(</span><span class="ss">:XAE</span><span class="p">,</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"XAE"</span><span class="p">,</span><span class="w"> </span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="5156322453-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5156322453-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5156322453-9">{</span><span class="nc">Cldr.CurrencyAlreadyDefined</span><span class="p">,</span><span class="w"> </span><span class="s">"Currency :XAE is already defined."</span><span class="p" data-group-id="5156322453-9">}</span><span class="p" data-group-id="5156322453-8">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="4278454803-3">}</span><span class="p" data-group-id="4278454803-2">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="4278454803-5">(</span><span class="ss">:XAH</span><span class="p">,</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"Custom Name"</span><span class="p" data-group-id="4278454803-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4278454803-6">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="s">"Required options are missing. Required options are [:name, :digits]"</span><span class="p" data-group-id="4278454803-6">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="4278454803-7">(</span><span class="ss">:XAE</span><span class="p">,</span><span class="w"> </span><span class="ss">name</span><span class="p">:</span><span class="w"> </span><span class="s">"XAE"</span><span class="p">,</span><span class="w"> </span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p" data-group-id="4278454803-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4278454803-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4278454803-9">{</span><span class="nc">Cldr.CurrencyAlreadyDefined</span><span class="p">,</span><span class="w"> </span><span class="s">"Currency :XAE is already defined."</span><span class="p" data-group-id="4278454803-9">}</span><span class="p" data-group-id="4278454803-8">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="pluralize/3">
|
||||
@ -1355,20 +1355,20 @@ default is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plaus
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="p" data-group-id="1276210404-1">(</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="1276210404-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1276210404-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"US dollar"</span><span class="p" data-group-id="1276210404-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="p" data-group-id="6830202985-1">(</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="6830202985-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6830202985-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"US dollar"</span><span class="p" data-group-id="6830202985-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="p" data-group-id="1276210404-3">(</span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="1276210404-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1276210404-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"US dollars"</span><span class="p" data-group-id="1276210404-4">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="p" data-group-id="6830202985-3">(</span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="6830202985-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6830202985-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"US dollars"</span><span class="p" data-group-id="6830202985-4">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="p" data-group-id="1276210404-5">(</span><span class="mi">12</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p" data-group-id="1276210404-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1276210404-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"美元"</span><span class="p" data-group-id="1276210404-6">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="p" data-group-id="6830202985-5">(</span><span class="mi">12</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"zh"</span><span class="p" data-group-id="6830202985-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6830202985-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"美元"</span><span class="p" data-group-id="6830202985-6">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="p" data-group-id="1276210404-7">(</span><span class="mi">12</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="1276210404-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1276210404-8">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"dollars des États-Unis"</span><span class="p" data-group-id="1276210404-8">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="p" data-group-id="6830202985-7">(</span><span class="mi">12</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="6830202985-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6830202985-8">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"dollars des États-Unis"</span><span class="p" data-group-id="6830202985-8">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="p" data-group-id="1276210404-9">(</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="1276210404-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1276210404-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"dollar des États-Unis"</span><span class="p" data-group-id="1276210404-10">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Currency</span><span class="o">.</span><span class="n">pluralize</span><span class="p" data-group-id="6830202985-9">(</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="6830202985-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6830202985-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"dollar des États-Unis"</span><span class="p" data-group-id="6830202985-10">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="strings_for_currency/2">
|
||||
@ -1410,8 +1410,8 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">strings_for_currency</span><span class="p" data-group-id="6341633385-1">(</span><span class="ss">:AUD</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="6341633385-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6341633385-2">[</span><span class="s">"a$"</span><span class="p">,</span><span class="w"> </span><span class="s">"australian dollars"</span><span class="p">,</span><span class="w"> </span><span class="s">"aud"</span><span class="p">,</span><span class="w"> </span><span class="s">"australian dollar"</span><span class="p" data-group-id="6341633385-2">]</span></code></pre>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">MyApp.Cldr.Currency</span><span class="o">.</span><span class="n">strings_for_currency</span><span class="p" data-group-id="8355691203-1">(</span><span class="ss">:AUD</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="8355691203-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8355691203-2">[</span><span class="s">"a$"</span><span class="p">,</span><span class="w"> </span><span class="s">"australian dollars"</span><span class="p">,</span><span class="w"> </span><span class="s">"aud"</span><span class="p">,</span><span class="w"> </span><span class="s">"australian dollar"</span><span class="p" data-group-id="8355691203-2">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -326,16 +326,16 @@ this specific locale..</p><h2 id="fallback_locale_names/1-arguments" class="sect
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locale_names</span><span class="p" data-group-id="9558381334-1">(</span><span class="ss">:"fr-CA"</span><span class="p" data-group-id="9558381334-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9558381334-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9558381334-3">[</span><span class="ss">:"fr-CA"</span><span class="p">,</span><span class="w"> </span><span class="ss">:fr</span><span class="p">,</span><span class="w"> </span><span class="ss">:und</span><span class="p" data-group-id="9558381334-3">]</span><span class="p" data-group-id="9558381334-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locale_names</span><span class="p" data-group-id="3855329493-1">(</span><span class="ss">:"fr-CA"</span><span class="p" data-group-id="3855329493-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3855329493-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3855329493-3">[</span><span class="ss">:"fr-CA"</span><span class="p">,</span><span class="w"> </span><span class="ss">:fr</span><span class="p">,</span><span class="w"> </span><span class="ss">:und</span><span class="p" data-group-id="3855329493-3">]</span><span class="p" data-group-id="3855329493-2">}</span><span class="w">
|
||||
|
||||
</span><span class="c1"># Fallbacks are typically formed by progressively</span><span class="w">
|
||||
</span><span class="c1"># stripping variant, territory and script from the</span><span class="w">
|
||||
</span><span class="c1"># given locale name. But not always - there are</span><span class="w">
|
||||
</span><span class="c1"># certain fallbacks that take a different path.</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locale_names</span><span class="p" data-group-id="9558381334-4">(</span><span class="ss">:nb</span><span class="p" data-group-id="9558381334-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9558381334-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9558381334-6">[</span><span class="ss">:nb</span><span class="p">,</span><span class="w"> </span><span class="ss">:no</span><span class="p">,</span><span class="w"> </span><span class="ss">:und</span><span class="p" data-group-id="9558381334-6">]</span><span class="p" data-group-id="9558381334-5">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locale_names</span><span class="p" data-group-id="3855329493-4">(</span><span class="ss">:nb</span><span class="p" data-group-id="3855329493-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3855329493-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3855329493-6">[</span><span class="ss">:nb</span><span class="p">,</span><span class="w"> </span><span class="ss">:no</span><span class="p">,</span><span class="w"> </span><span class="ss">:und</span><span class="p" data-group-id="3855329493-6">]</span><span class="p" data-group-id="3855329493-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="fallback_locales/1">
|
||||
@ -389,20 +389,20 @@ this specific locale.</p><h2 id="fallback_locales/1-arguments" class="section-he
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locales</span><span class="p" data-group-id="8028510777-1">(</span><span class="ss">:"fr-CA"</span><span class="p" data-group-id="8028510777-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="8028510777-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8028510777-3">[</span><span class="p" data-group-id="8028510777-4">#</span><span class="nc" data-group-id="8028510777-4">Cldr.LanguageTag</span><span class="p" data-group-id="8028510777-4"><</span><span class="n">fr</span><span class="o">-</span><span class="nc">CA</span><span class="w"> </span><span class="p" data-group-id="8028510777-5">[</span><span class="n">validated</span><span class="p" data-group-id="8028510777-5">]</span><span class="p" data-group-id="8028510777-4">></span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8028510777-6">#</span><span class="nc" data-group-id="8028510777-6">Cldr.LanguageTag</span><span class="p" data-group-id="8028510777-6"><</span><span class="n">fr</span><span class="w"> </span><span class="p" data-group-id="8028510777-7">[</span><span class="n">validated</span><span class="p" data-group-id="8028510777-7">]</span><span class="p" data-group-id="8028510777-6">></span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8028510777-8">#</span><span class="nc" data-group-id="8028510777-8">Cldr.LanguageTag</span><span class="p" data-group-id="8028510777-8"><</span><span class="n">und</span><span class="w"> </span><span class="p" data-group-id="8028510777-9">[</span><span class="n">validated</span><span class="p" data-group-id="8028510777-9">]</span><span class="p" data-group-id="8028510777-8">></span><span class="p" data-group-id="8028510777-3">]</span><span class="p" data-group-id="8028510777-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locales</span><span class="p" data-group-id="6493431792-1">(</span><span class="ss">:"fr-CA"</span><span class="p" data-group-id="6493431792-1">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6493431792-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6493431792-3">[</span><span class="p" data-group-id="6493431792-4">#</span><span class="nc" data-group-id="6493431792-4">Cldr.LanguageTag</span><span class="p" data-group-id="6493431792-4"><</span><span class="n">fr</span><span class="o">-</span><span class="nc">CA</span><span class="w"> </span><span class="p" data-group-id="6493431792-5">[</span><span class="n">validated</span><span class="p" data-group-id="6493431792-5">]</span><span class="p" data-group-id="6493431792-4">></span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6493431792-6">#</span><span class="nc" data-group-id="6493431792-6">Cldr.LanguageTag</span><span class="p" data-group-id="6493431792-6"><</span><span class="n">fr</span><span class="w"> </span><span class="p" data-group-id="6493431792-7">[</span><span class="n">validated</span><span class="p" data-group-id="6493431792-7">]</span><span class="p" data-group-id="6493431792-6">></span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6493431792-8">#</span><span class="nc" data-group-id="6493431792-8">Cldr.LanguageTag</span><span class="p" data-group-id="6493431792-8"><</span><span class="n">und</span><span class="w"> </span><span class="p" data-group-id="6493431792-9">[</span><span class="n">validated</span><span class="p" data-group-id="6493431792-9">]</span><span class="p" data-group-id="6493431792-8">></span><span class="p" data-group-id="6493431792-3">]</span><span class="p" data-group-id="6493431792-2">}</span><span class="w">
|
||||
|
||||
</span><span class="c1"># Fallbacks are typically formed by progressively</span><span class="w">
|
||||
</span><span class="c1"># stripping variant, territory and script from the</span><span class="w">
|
||||
</span><span class="c1"># given locale name. But not always - there are</span><span class="w">
|
||||
</span><span class="c1"># certain fallbacks that take a different path.</span><span class="w">
|
||||
|
||||
</span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locales</span><span class="p" data-group-id="8028510777-10">(</span><span class="ss">:nb</span><span class="p" data-group-id="8028510777-10">)</span><span class="p">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="8028510777-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8028510777-12">[</span><span class="p" data-group-id="8028510777-13">#</span><span class="nc" data-group-id="8028510777-13">Cldr.LanguageTag</span><span class="p" data-group-id="8028510777-13"><</span><span class="n">nb</span><span class="w"> </span><span class="p" data-group-id="8028510777-14">[</span><span class="n">validated</span><span class="p" data-group-id="8028510777-14">]</span><span class="p" data-group-id="8028510777-13">></span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8028510777-15">#</span><span class="nc" data-group-id="8028510777-15">Cldr.LanguageTag</span><span class="p" data-group-id="8028510777-15"><</span><span class="n">no</span><span class="w"> </span><span class="p" data-group-id="8028510777-16">[</span><span class="n">validated</span><span class="p" data-group-id="8028510777-16">]</span><span class="p" data-group-id="8028510777-15">></span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8028510777-17">#</span><span class="nc" data-group-id="8028510777-17">Cldr.LanguageTag</span><span class="p" data-group-id="8028510777-17"><</span><span class="n">und</span><span class="w"> </span><span class="p" data-group-id="8028510777-18">[</span><span class="n">validated</span><span class="p" data-group-id="8028510777-18">]</span><span class="p" data-group-id="8028510777-17">></span><span class="p" data-group-id="8028510777-12">]</span><span class="p" data-group-id="8028510777-11">}</span></code></pre>
|
||||
</span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">fallback_locales</span><span class="p" data-group-id="6493431792-10">(</span><span class="ss">:nb</span><span class="p" data-group-id="6493431792-10">)</span><span class="p">)</span><span class="w">
|
||||
</span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="6493431792-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6493431792-12">[</span><span class="p" data-group-id="6493431792-13">#</span><span class="nc" data-group-id="6493431792-13">Cldr.LanguageTag</span><span class="p" data-group-id="6493431792-13"><</span><span class="n">nb</span><span class="w"> </span><span class="p" data-group-id="6493431792-14">[</span><span class="n">validated</span><span class="p" data-group-id="6493431792-14">]</span><span class="p" data-group-id="6493431792-13">></span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6493431792-15">#</span><span class="nc" data-group-id="6493431792-15">Cldr.LanguageTag</span><span class="p" data-group-id="6493431792-15"><</span><span class="n">no</span><span class="w"> </span><span class="p" data-group-id="6493431792-16">[</span><span class="n">validated</span><span class="p" data-group-id="6493431792-16">]</span><span class="p" data-group-id="6493431792-15">></span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6493431792-17">#</span><span class="nc" data-group-id="6493431792-17">Cldr.LanguageTag</span><span class="p" data-group-id="6493431792-17"><</span><span class="n">und</span><span class="w"> </span><span class="p" data-group-id="6493431792-18">[</span><span class="n">validated</span><span class="p" data-group-id="6493431792-18">]</span><span class="p" data-group-id="6493431792-17">></span><span class="p" data-group-id="6493431792-12">]</span><span class="p" data-group-id="6493431792-11">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="locale_for_territory/1">
|
||||
@ -533,15 +533,15 @@ generic top-level domain names.</p><h2 id="locale_from_host/2-examples" class="s
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">locale_from_host</span><span class="w"> </span><span class="s">"a.b.com.au"</span><span class="w">
|
||||
</span><span class="nc">Elixir.Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="7866129723-1">(</span><span class="ss">:"en-AU"</span><span class="p" data-group-id="7866129723-1">)</span><span class="w">
|
||||
</span><span class="nc">Elixir.Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="0582678756-1">(</span><span class="ss">:"en-AU"</span><span class="p" data-group-id="0582678756-1">)</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">locale_from_host</span><span class="p" data-group-id="7866129723-2">(</span><span class="s">"a.b.com.tv"</span><span class="p" data-group-id="7866129723-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7866129723-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7866129723-4">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w"> </span><span class="s">"No locale was identified for territory </span><span class="se">\"</span><span class="s">tv</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="7866129723-4">}</span><span class="p" data-group-id="7866129723-3">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">locale_from_host</span><span class="p" data-group-id="0582678756-2">(</span><span class="s">"a.b.com.tv"</span><span class="p" data-group-id="0582678756-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0582678756-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0582678756-4">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w"> </span><span class="s">"No locale was identified for territory </span><span class="se">\"</span><span class="s">tv</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="0582678756-4">}</span><span class="p" data-group-id="0582678756-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">locale_from_host</span><span class="p" data-group-id="7866129723-5">(</span><span class="s">"a.b.com"</span><span class="p" data-group-id="7866129723-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7866129723-6">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7866129723-7">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w"> </span><span class="s">"No locale was identified for territory </span><span class="se">\"</span><span class="s">com</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="7866129723-7">}</span><span class="p" data-group-id="7866129723-6">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Locale</span><span class="o">.</span><span class="n">locale_from_host</span><span class="p" data-group-id="0582678756-5">(</span><span class="s">"a.b.com"</span><span class="p" data-group-id="0582678756-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0582678756-6">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0582678756-7">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w"> </span><span class="s">"No locale was identified for territory </span><span class="se">\"</span><span class="s">com</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="0582678756-7">}</span><span class="p" data-group-id="0582678756-6">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="new/1">
|
||||
@ -683,12 +683,12 @@ be a territory.</p><h2 id="territory_from_host/1-arguments" class="section-headi
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.Locale</span><span class="o">.</span><span class="n">territory_from_host</span><span class="p" data-group-id="9801061149-1">(</span><span class="s">"a.b.com.au"</span><span class="p" data-group-id="9801061149-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9801061149-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:AU</span><span class="p" data-group-id="9801061149-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.Locale</span><span class="o">.</span><span class="n">territory_from_host</span><span class="p" data-group-id="8162212705-1">(</span><span class="s">"a.b.com.au"</span><span class="p" data-group-id="8162212705-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8162212705-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:AU</span><span class="p" data-group-id="8162212705-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Cldr.Locale</span><span class="o">.</span><span class="n">territory_from_host</span><span class="p" data-group-id="9801061149-3">(</span><span class="s">"a.b.com"</span><span class="p" data-group-id="9801061149-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9801061149-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9801061149-5">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w"> </span><span class="s">"No locale was identified for territory </span><span class="se">\"</span><span class="s">com</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="9801061149-5">}</span><span class="p" data-group-id="9801061149-4">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Cldr.Locale</span><span class="o">.</span><span class="n">territory_from_host</span><span class="p" data-group-id="8162212705-3">(</span><span class="s">"a.b.com"</span><span class="p" data-group-id="8162212705-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8162212705-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8162212705-5">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w"> </span><span class="s">"No locale was identified for territory </span><span class="se">\"</span><span class="s">com</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="8162212705-5">}</span><span class="p" data-group-id="8162212705-4">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="territory_from_locale/1">
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -455,31 +455,31 @@ The valid substitution keys are <code class="inline">:zero</code>, <code class="
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1586934791-1">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="1586934791-1">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7607105059-1">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="7607105059-1">}</span><span class="w">
|
||||
</span><span class="s">"one"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1586934791-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="1586934791-2">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7607105059-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="7607105059-2">}</span><span class="w">
|
||||
</span><span class="no">nil</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1586934791-3">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</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">"other"</span><span class="p" data-group-id="1586934791-3">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7607105059-3">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</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">"other"</span><span class="p" data-group-id="7607105059-3">}</span><span class="w">
|
||||
</span><span class="s">"other"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">22</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1586934791-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</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">"other"</span><span class="p" data-group-id="1586934791-4">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">22</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7607105059-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</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">"other"</span><span class="p" data-group-id="7607105059-4">}</span><span class="w">
|
||||
</span><span class="s">"other"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="1586934791-5">(</span><span class="mi">1</span><span class="p" data-group-id="1586934791-5">)</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1586934791-6">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="1586934791-6">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="7607105059-5">(</span><span class="mi">1</span><span class="p" data-group-id="7607105059-5">)</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7607105059-6">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="7607105059-6">}</span><span class="w">
|
||||
</span><span class="s">"one"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="1586934791-7">(</span><span class="mi">2</span><span class="p" data-group-id="1586934791-7">)</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1586934791-8">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="1586934791-8">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="7607105059-7">(</span><span class="mi">2</span><span class="p" data-group-id="7607105059-7">)</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7607105059-8">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="7607105059-8">}</span><span class="w">
|
||||
</span><span class="no">nil</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="1586934791-9">(</span><span class="mi">2</span><span class="p" data-group-id="1586934791-9">)</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1586934791-10">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p" data-group-id="1586934791-10">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="7607105059-9">(</span><span class="mi">2</span><span class="p" data-group-id="7607105059-9">)</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7607105059-10">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p" data-group-id="7607105059-10">}</span><span class="w">
|
||||
</span><span class="no">nil</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"ar"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1586934791-11">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</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">"other"</span><span class="p" data-group-id="1586934791-11">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"ar"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7607105059-11">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</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">"other"</span><span class="p" data-group-id="7607105059-11">}</span><span class="w">
|
||||
</span><span class="s">"few"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1586934791-12">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</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">"other"</span><span class="p" data-group-id="1586934791-12">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Cardinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7607105059-12">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</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">"other"</span><span class="p" data-group-id="7607105059-12">}</span><span class="w">
|
||||
</span><span class="s">"other"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -468,7 +468,7 @@ to precompile all the known formats at compile time.</p><h2 id="decimal_format_l
|
||||
<span class="text">Example</span>
|
||||
</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="1576111822-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="p" data-group-id="2176761492-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">
|
||||
@ -478,7 +478,7 @@ to precompile all the known formats at compile time.</p><h2 id="decimal_format_l
|
||||
</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="1576111822-1">]</span></code></pre>
|
||||
</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="2176761492-1">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="decimal_format_list_for/1">
|
||||
@ -526,8 +526,8 @@ the known formats at compile time. Its use is not otherwise recommended.</p><h2
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</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="2379031800-1">(</span><span class="ss">:en</span><span class="p" data-group-id="2379031800-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2379031800-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2379031800-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">
|
||||
<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="3365589375-1">(</span><span class="ss">:en</span><span class="p" data-group-id="3365589375-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3365589375-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3365589375-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">
|
||||
@ -535,7 +535,7 @@ the known formats at compile time. Its use is not otherwise recommended.</p><h2
|
||||
</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="2379031800-3">]</span><span class="p" data-group-id="2379031800-2">}</span></code></pre>
|
||||
</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="3365589375-3">]</span><span class="p" data-group-id="3365589375-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="default_grouping_for/1">
|
||||
@ -588,8 +588,8 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="0366011442-1">(</span><span class="ss">:en</span><span class="p" data-group-id="0366011442-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0366011442-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0366011442-3">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0366011442-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="0366011442-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="0366011442-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="0366011442-5">}</span><span class="p" data-group-id="0366011442-3">}</span><span class="p" data-group-id="0366011442-2">}</span></code></pre>
|
||||
<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="5432051389-1">(</span><span class="ss">:en</span><span class="p" data-group-id="5432051389-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5432051389-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5432051389-3">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5432051389-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="5432051389-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="5432051389-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="5432051389-5">}</span><span class="p" data-group-id="5432051389-3">}</span><span class="p" data-group-id="5432051389-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="default_grouping_for!/1">
|
||||
@ -641,8 +641,8 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="5031229264-1">(</span><span class="ss">:en</span><span class="p" data-group-id="5031229264-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5031229264-2">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5031229264-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="5031229264-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="5031229264-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="5031229264-4">}</span><span class="p" data-group-id="5031229264-2">}</span></code></pre>
|
||||
<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="8673787744-1">(</span><span class="ss">:en</span><span class="p" data-group-id="8673787744-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8673787744-2">%{</span><span class="ss">fraction</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8673787744-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="8673787744-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="8673787744-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="8673787744-4">}</span><span class="p" data-group-id="8673787744-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="formats_for/2">
|
||||
@ -699,18 +699,18 @@ by <a href="Plausible.Cldr.Number.System.html#number_systems_for/1"><code class=
|
||||
</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="8409272247-1">[</span><span class="p" data-group-id="8409272247-2">{</span><span class="s">"1000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8409272247-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="8409272247-3">]</span><span class="p" data-group-id="8409272247-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8409272247-4">{</span><span class="s">"10000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8409272247-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="8409272247-5">]</span><span class="p" data-group-id="8409272247-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8409272247-6">{</span><span class="s">"100000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8409272247-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="8409272247-7">]</span><span class="p" data-group-id="8409272247-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8409272247-8">{</span><span class="s">"1000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8409272247-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="8409272247-9">]</span><span class="p" data-group-id="8409272247-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8409272247-10">{</span><span class="s">"10000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8409272247-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="8409272247-11">]</span><span class="p" data-group-id="8409272247-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8409272247-12">{</span><span class="s">"100000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8409272247-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="8409272247-13">]</span><span class="p" data-group-id="8409272247-12">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8409272247-14">{</span><span class="s">"1000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8409272247-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="8409272247-15">]</span><span class="p" data-group-id="8409272247-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8409272247-16">{</span><span class="s">"10000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8409272247-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="8409272247-17">]</span><span class="p" data-group-id="8409272247-16">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8409272247-18">{</span><span class="s">"100000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8409272247-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="8409272247-19">]</span><span class="p" data-group-id="8409272247-18">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8409272247-20">{</span><span class="s">"1000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8409272247-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="8409272247-21">]</span><span class="p" data-group-id="8409272247-20">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8409272247-22">{</span><span class="s">"10000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8409272247-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="8409272247-23">]</span><span class="p" data-group-id="8409272247-22">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8409272247-24">{</span><span class="s">"100000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8409272247-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="8409272247-25">]</span><span class="p" data-group-id="8409272247-24">}</span><span class="p" data-group-id="8409272247-1">]</span><span class="p">,</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="4729991603-1">[</span><span class="p" data-group-id="4729991603-2">{</span><span class="s">"1000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4729991603-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="4729991603-3">]</span><span class="p" data-group-id="4729991603-2">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4729991603-4">{</span><span class="s">"10000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4729991603-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="4729991603-5">]</span><span class="p" data-group-id="4729991603-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4729991603-6">{</span><span class="s">"100000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4729991603-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="4729991603-7">]</span><span class="p" data-group-id="4729991603-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4729991603-8">{</span><span class="s">"1000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4729991603-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="4729991603-9">]</span><span class="p" data-group-id="4729991603-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4729991603-10">{</span><span class="s">"10000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4729991603-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="4729991603-11">]</span><span class="p" data-group-id="4729991603-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4729991603-12">{</span><span class="s">"100000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4729991603-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="4729991603-13">]</span><span class="p" data-group-id="4729991603-12">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4729991603-14">{</span><span class="s">"1000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4729991603-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="4729991603-15">]</span><span class="p" data-group-id="4729991603-14">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4729991603-16">{</span><span class="s">"10000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4729991603-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="4729991603-17">]</span><span class="p" data-group-id="4729991603-16">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4729991603-18">{</span><span class="s">"100000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4729991603-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="4729991603-19">]</span><span class="p" data-group-id="4729991603-18">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4729991603-20">{</span><span class="s">"1000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4729991603-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="4729991603-21">]</span><span class="p" data-group-id="4729991603-20">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4729991603-22">{</span><span class="s">"10000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4729991603-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="4729991603-23">]</span><span class="p" data-group-id="4729991603-22">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4729991603-24">{</span><span class="s">"100000000000000"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4729991603-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="4729991603-25">]</span><span class="p" data-group-id="4729991603-24">}</span><span class="p" data-group-id="4729991603-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>
|
||||
@ -801,8 +801,8 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="0508289789-1">(</span><span class="s">"en"</span><span class="p" data-group-id="0508289789-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0508289789-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="0508289789-2">}</span></code></pre>
|
||||
<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="1759205179-1">(</span><span class="s">"en"</span><span class="p" data-group-id="1759205179-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1759205179-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="1759205179-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="minimum_grouping_digits_for!/1">
|
||||
@ -854,7 +854,7 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</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="3483151013-1">(</span><span class="s">"en"</span><span class="p" data-group-id="3483151013-1">)</span><span class="w">
|
||||
<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="4645028163-1">(</span><span class="s">"en"</span><span class="p" data-group-id="4645028163-1">)</span><span class="w">
|
||||
</span><span class="mi">1</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -458,31 +458,31 @@ The valid substitution keys are <code class="inline">:zero</code>, <code class="
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0353693654-1">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="0353693654-1">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4101305398-1">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="4101305398-1">}</span><span class="w">
|
||||
</span><span class="s">"one"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0353693654-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="0353693654-2">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4101305398-2">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="4101305398-2">}</span><span class="w">
|
||||
</span><span class="no">nil</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0353693654-3">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p" data-group-id="0353693654-3">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4101305398-3">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p" data-group-id="4101305398-3">}</span><span class="w">
|
||||
</span><span class="s">"two"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">22</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0353693654-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</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">"other"</span><span class="p" data-group-id="0353693654-4">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">22</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4101305398-4">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</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">"other"</span><span class="p" data-group-id="4101305398-4">}</span><span class="w">
|
||||
</span><span class="s">"two"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="0353693654-5">(</span><span class="mi">1</span><span class="p" data-group-id="0353693654-5">)</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0353693654-6">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="0353693654-6">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="4101305398-5">(</span><span class="mi">1</span><span class="p" data-group-id="4101305398-5">)</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4101305398-6">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="4101305398-6">}</span><span class="w">
|
||||
</span><span class="s">"one"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="0353693654-7">(</span><span class="mi">2</span><span class="p" data-group-id="0353693654-7">)</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0353693654-8">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="0353693654-8">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="4101305398-7">(</span><span class="mi">2</span><span class="p" data-group-id="4101305398-7">)</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4101305398-8">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p" data-group-id="4101305398-8">}</span><span class="w">
|
||||
</span><span class="no">nil</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="0353693654-9">(</span><span class="mi">2</span><span class="p" data-group-id="0353693654-9">)</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0353693654-10">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p" data-group-id="0353693654-10">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="nc">Decimal</span><span class="o">.</span><span class="n">new</span><span class="p" data-group-id="4101305398-9">(</span><span class="mi">2</span><span class="p" data-group-id="4101305398-9">)</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4101305398-10">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">two</span><span class="p">:</span><span class="w"> </span><span class="s">"two"</span><span class="p" data-group-id="4101305398-10">}</span><span class="w">
|
||||
</span><span class="s">"two"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"ar"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0353693654-11">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</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">"other"</span><span class="p" data-group-id="0353693654-11">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"ar"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4101305398-11">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</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">"other"</span><span class="p" data-group-id="4101305398-11">}</span><span class="w">
|
||||
</span><span class="s">"other"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0353693654-12">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</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">"other"</span><span class="p" data-group-id="0353693654-12">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Ordinal</span><span class="o">.</span><span class="n">pluralize</span><span class="w"> </span><span class="mi">1</span><span class="o">..</span><span class="mi">10</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4101305398-12">%{</span><span class="ss">one</span><span class="p">:</span><span class="w"> </span><span class="s">"one"</span><span class="p">,</span><span class="w"> </span><span class="ss">few</span><span class="p">:</span><span class="w"> </span><span class="s">"few"</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">"other"</span><span class="p" data-group-id="4101305398-12">}</span><span class="w">
|
||||
</span><span class="s">"other"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -378,9 +378,9 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</a>
|
||||
<span class="text">Example:</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Symbol</span><span class="o">.</span><span class="n">number_symbols_for</span><span class="p" data-group-id="2065269971-1">(</span><span class="ss">:th</span><span class="p" data-group-id="2065269971-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2065269971-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2065269971-3">%{</span><span class="w">
|
||||
</span><span class="ss">latn</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2065269971-4">%</span><span class="nc" data-group-id="2065269971-4">Cldr.Number.Symbol</span><span class="p" data-group-id="2065269971-4">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Symbol</span><span class="o">.</span><span class="n">number_symbols_for</span><span class="p" data-group-id="5134600057-1">(</span><span class="ss">:th</span><span class="p" data-group-id="5134600057-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5134600057-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5134600057-3">%{</span><span class="w">
|
||||
</span><span class="ss">latn</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5134600057-4">%</span><span class="nc" data-group-id="5134600057-4">Cldr.Number.Symbol</span><span class="p" data-group-id="5134600057-4">{</span><span class="w">
|
||||
</span><span class="ss">decimal</span><span class="p">:</span><span class="w"> </span><span class="s">"."</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">exponential</span><span class="p">:</span><span class="w"> </span><span class="s">"E"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">group</span><span class="p">:</span><span class="w"> </span><span class="s">","</span><span class="p">,</span><span class="w">
|
||||
@ -393,8 +393,8 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</span><span class="ss">plus_sign</span><span class="p">:</span><span class="w"> </span><span class="s">"+"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">superscripting_exponent</span><span class="p">:</span><span class="w"> </span><span class="s">"×"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">time_separator</span><span class="p">:</span><span class="w"> </span><span class="s">":"</span><span class="w">
|
||||
</span><span class="p" data-group-id="2065269971-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">thai</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2065269971-5">%</span><span class="nc" data-group-id="2065269971-5">Cldr.Number.Symbol</span><span class="p" data-group-id="2065269971-5">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="5134600057-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">thai</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5134600057-5">%</span><span class="nc" data-group-id="5134600057-5">Cldr.Number.Symbol</span><span class="p" data-group-id="5134600057-5">{</span><span class="w">
|
||||
</span><span class="ss">decimal</span><span class="p">:</span><span class="w"> </span><span class="s">"."</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">exponential</span><span class="p">:</span><span class="w"> </span><span class="s">"E"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">group</span><span class="p">:</span><span class="w"> </span><span class="s">","</span><span class="p">,</span><span class="w">
|
||||
@ -407,8 +407,8 @@ is <a href="Plausible.Cldr.html#get_locale/0"><code class="inline">Plausible.Cld
|
||||
</span><span class="ss">plus_sign</span><span class="p">:</span><span class="w"> </span><span class="s">"+"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">superscripting_exponent</span><span class="p">:</span><span class="w"> </span><span class="s">"×"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">time_separator</span><span class="p">:</span><span class="w"> </span><span class="s">":"</span><span class="w">
|
||||
</span><span class="p" data-group-id="2065269971-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="2065269971-3">}</span><span class="p" data-group-id="2065269971-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="5134600057-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="5134600057-3">}</span><span class="p" data-group-id="5134600057-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="number_symbols_for/2">
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -317,23 +317,23 @@ it is returned as is.</p><h2 id="number_system_for/2-examples" class="section-he
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_for</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="w">
|
||||
</span><span class="p" data-group-id="9597097232-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9597097232-2">%{</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="s">"0123456789"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:numeric</span><span class="p" data-group-id="9597097232-2">}</span><span class="p" data-group-id="9597097232-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8132968776-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8132968776-2">%{</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="s">"0123456789"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:numeric</span><span class="p" data-group-id="8132968776-2">}</span><span class="p" data-group-id="8132968776-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_for</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="w">
|
||||
</span><span class="p" data-group-id="9597097232-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9597097232-4">%{</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="s">"0123456789"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:numeric</span><span class="p" data-group-id="9597097232-4">}</span><span class="p" data-group-id="9597097232-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8132968776-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8132968776-4">%{</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="s">"0123456789"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:numeric</span><span class="p" data-group-id="8132968776-4">}</span><span class="p" data-group-id="8132968776-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_for</span><span class="w"> </span><span class="s">"he"</span><span class="p">,</span><span class="w"> </span><span class="ss">:traditional</span><span class="w">
|
||||
</span><span class="p" data-group-id="9597097232-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9597097232-6">%{</span><span class="ss">rules</span><span class="p">:</span><span class="w"> </span><span class="s">"hebrew"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:algorithmic</span><span class="p" data-group-id="9597097232-6">}</span><span class="p" data-group-id="9597097232-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8132968776-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8132968776-6">%{</span><span class="ss">rules</span><span class="p">:</span><span class="w"> </span><span class="s">"hebrew"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:algorithmic</span><span class="p" data-group-id="8132968776-6">}</span><span class="p" data-group-id="8132968776-5">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_for</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="ss">:native</span><span class="w">
|
||||
</span><span class="p" data-group-id="9597097232-7">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9597097232-8">%{</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="s">"0123456789"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:numeric</span><span class="p" data-group-id="9597097232-8">}</span><span class="p" data-group-id="9597097232-7">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8132968776-7">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8132968776-8">%{</span><span class="ss">digits</span><span class="p">:</span><span class="w"> </span><span class="s">"0123456789"</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="ss">:numeric</span><span class="p" data-group-id="8132968776-8">}</span><span class="p" data-group-id="8132968776-7">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_for</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="ss">:finance</span><span class="w">
|
||||
</span><span class="p" data-group-id="9597097232-9">{</span><span class="w">
|
||||
</span><span class="p" data-group-id="8132968776-9">{</span><span class="w">
|
||||
</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="9597097232-10">{</span><span class="nc">Cldr.UnknownNumberSystemError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The number system :finance is unknown for the locale named :en. Valid number systems are %{default: :latn, native: :latn}"</span><span class="p" data-group-id="9597097232-10">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9597097232-9">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="8132968776-10">{</span><span class="nc">Cldr.UnknownNumberSystemError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The number system :finance is unknown for the locale named :en. Valid number systems are %{default: :latn, native: :latn}"</span><span class="p" data-group-id="8132968776-10">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8132968776-9">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="number_system_from_locale/1">
|
||||
@ -424,10 +424,10 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_names_for</span><span class="w"> </span><span class="s">"en"</span><span class="w">
|
||||
</span><span class="p" data-group-id="8297835163-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8297835163-2">[</span><span class="ss">:latn</span><span class="p" data-group-id="8297835163-2">]</span><span class="p" data-group-id="8297835163-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0221885716-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0221885716-2">[</span><span class="ss">:latn</span><span class="p" data-group-id="0221885716-2">]</span><span class="p" data-group-id="0221885716-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_system_names_for</span><span class="w"> </span><span class="s">"zz"</span><span class="w">
|
||||
</span><span class="p" data-group-id="8297835163-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8297835163-4">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="8297835163-4">}</span><span class="p" data-group-id="8297835163-3">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="0221885716-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0221885716-4">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="0221885716-4">}</span><span class="p" data-group-id="0221885716-3">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="number_system_names_for!/1">
|
||||
@ -509,13 +509,13 @@ or a <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.LanguageTag.html"><code cla
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_systems_for</span><span class="w"> </span><span class="s">"en"</span><span class="w">
|
||||
</span><span class="p" data-group-id="5032065556-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5032065556-2">%{</span><span class="ss">default</span><span class="p">:</span><span class="w"> </span><span class="ss">:latn</span><span class="p">,</span><span class="w"> </span><span class="ss">native</span><span class="p">:</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="5032065556-2">}</span><span class="p" data-group-id="5032065556-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9589544213-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9589544213-2">%{</span><span class="ss">default</span><span class="p">:</span><span class="w"> </span><span class="ss">:latn</span><span class="p">,</span><span class="w"> </span><span class="ss">native</span><span class="p">:</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="9589544213-2">}</span><span class="p" data-group-id="9589544213-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_systems_for</span><span class="w"> </span><span class="s">"th"</span><span class="w">
|
||||
</span><span class="p" data-group-id="5032065556-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5032065556-4">%{</span><span class="ss">default</span><span class="p">:</span><span class="w"> </span><span class="ss">:latn</span><span class="p">,</span><span class="w"> </span><span class="ss">native</span><span class="p">:</span><span class="w"> </span><span class="ss">:thai</span><span class="p" data-group-id="5032065556-4">}</span><span class="p" data-group-id="5032065556-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9589544213-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9589544213-4">%{</span><span class="ss">default</span><span class="p">:</span><span class="w"> </span><span class="ss">:latn</span><span class="p">,</span><span class="w"> </span><span class="ss">native</span><span class="p">:</span><span class="w"> </span><span class="ss">:thai</span><span class="p" data-group-id="9589544213-4">}</span><span class="p" data-group-id="9589544213-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">number_systems_for</span><span class="w"> </span><span class="s">"zz"</span><span class="w">
|
||||
</span><span class="p" data-group-id="5032065556-5">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="5032065556-6">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="5032065556-6">}</span><span class="p" data-group-id="5032065556-5">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="9589544213-5">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9589544213-6">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="9589544213-6">}</span><span class="p" data-group-id="9589544213-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="number_systems_for!/1">
|
||||
@ -613,20 +613,20 @@ actual system name.</p><h2 id="system_name_from/2-examples" class="section-headi
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="n">ex</span><span class="o">></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="1070726929-1">(</span><span class="ss">:default</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="1070726929-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1070726929-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="1070726929-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="n">ex</span><span class="o">></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="9260279884-1">(</span><span class="ss">:default</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="9260279884-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9260279884-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="9260279884-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="1070726929-3">(</span><span class="s">"latn"</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="1070726929-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1070726929-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="1070726929-4">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="9260279884-3">(</span><span class="s">"latn"</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="9260279884-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9260279884-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="9260279884-4">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="1070726929-5">(</span><span class="ss">:native</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="1070726929-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1070726929-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="1070726929-6">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="9260279884-5">(</span><span class="ss">:native</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="9260279884-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9260279884-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="9260279884-6">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="1070726929-7">(</span><span class="ss">:nope</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="1070726929-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1070726929-8">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">system_name_from</span><span class="p" data-group-id="9260279884-7">(</span><span class="ss">:nope</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="9260279884-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9260279884-8">{</span><span class="w">
|
||||
</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="1070726929-9">{</span><span class="nc">Cldr.UnknownNumberSystemError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system :nope is unknown"</span><span class="p" data-group-id="1070726929-9">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1070726929-8">}</span></code></pre><p>Note that return value is not guaranteed to be a valid
|
||||
</span><span class="p" data-group-id="9260279884-9">{</span><span class="nc">Cldr.UnknownNumberSystemError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system :nope is unknown"</span><span class="p" data-group-id="9260279884-9">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9260279884-8">}</span></code></pre><p>Note that return value is not guaranteed to be a valid
|
||||
number system for the given locale as demonstrated in the third example.</p>
|
||||
</section>
|
||||
</section>
|
||||
@ -673,16 +673,16 @@ is recommended.</p></li></ul><h2 id="to_system/2-examples" class="section-headin
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">to_system</span><span class="w"> </span><span class="mi">123456</span><span class="p">,</span><span class="w"> </span><span class="ss">:hebr</span><span class="w">
|
||||
</span><span class="p" data-group-id="5554671061-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"קכ״ג׳תנ״ו"</span><span class="p" data-group-id="5554671061-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8786207317-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"קכ״ג׳תנ״ו"</span><span class="p" data-group-id="8786207317-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">to_system</span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:hans</span><span class="w">
|
||||
</span><span class="p" data-group-id="5554671061-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"一百二十三"</span><span class="p" data-group-id="5554671061-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8786207317-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"一百二十三"</span><span class="p" data-group-id="8786207317-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">to_system</span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:hant</span><span class="w">
|
||||
</span><span class="p" data-group-id="5554671061-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"一百二十三"</span><span class="p" data-group-id="5554671061-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8786207317-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"一百二十三"</span><span class="p" data-group-id="8786207317-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.System</span><span class="o">.</span><span class="n">to_system</span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:hansfin</span><span class="w">
|
||||
</span><span class="p" data-group-id="5554671061-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"壹佰贰拾叁"</span><span class="p" data-group-id="5554671061-4">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="8786207317-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"壹佰贰拾叁"</span><span class="p" data-group-id="8786207317-4">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_system!/2">
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -162,12 +162,12 @@ digits between number systems. For example from :arabic to :latn. Since genera
|
||||
transliteration map is slow, pairs of transliterations can be configured so that the
|
||||
transliteration map is created at compile time and therefore speeding up transliteration at
|
||||
run time.</p><p>To configure these transliteration pairs, add the to the <code class="inline">use Cldr</code> configuration
|
||||
in a backend module:</p><pre><code class="makeup elixir" translate="no"><span class="kd">defmodule</span><span class="w"> </span><span class="nc">MyApp.Cldr</span><span class="w"> </span><span class="k" data-group-id="7649380544-1">do</span><span class="w">
|
||||
in a backend module:</p><pre><code class="makeup elixir" translate="no"><span class="kd">defmodule</span><span class="w"> </span><span class="nc">MyApp.Cldr</span><span class="w"> </span><span class="k" data-group-id="4406866420-1">do</span><span class="w">
|
||||
</span><span class="kn">use</span><span class="w"> </span><span class="nc">Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7649380544-2">[</span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="s">"fr"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p" data-group-id="7649380544-2">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4406866420-2">[</span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="s">"fr"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p" data-group-id="4406866420-2">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">default_locale</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">precompile_transliterations</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7649380544-3">[</span><span class="p" data-group-id="7649380544-4">{</span><span class="ss">:latn</span><span class="p">,</span><span class="w"> </span><span class="ss">:thai</span><span class="p" data-group-id="7649380544-4">}</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="7649380544-5">{</span><span class="ss">:arab</span><span class="p">,</span><span class="w"> </span><span class="ss">:thai</span><span class="p" data-group-id="7649380544-5">}</span><span class="p" data-group-id="7649380544-3">]</span><span class="w">
|
||||
</span><span class="k" data-group-id="7649380544-1">end</span></code></pre><p>Where each tuple in the list configures one transliteration map. In this example, two maps are
|
||||
</span><span class="ss">precompile_transliterations</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4406866420-3">[</span><span class="p" data-group-id="4406866420-4">{</span><span class="ss">:latn</span><span class="p">,</span><span class="w"> </span><span class="ss">:thai</span><span class="p" data-group-id="4406866420-4">}</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4406866420-5">{</span><span class="ss">:arab</span><span class="p">,</span><span class="w"> </span><span class="ss">:thai</span><span class="p" data-group-id="4406866420-5">}</span><span class="p" data-group-id="4406866420-3">]</span><span class="w">
|
||||
</span><span class="k" data-group-id="4406866420-1">end</span></code></pre><p>Where each tuple in the list configures one transliteration map. In this example, two maps are
|
||||
configured: from <code class="inline">:latn</code> to <code class="inline">:thai</code> and from <code class="inline">:arab</code> to <code class="inline">:thai</code>.</p><p>A list of configurable number systems is returned by <a href="https://hexdocs.pm/ex_cldr_numbers/2.32.3/Cldr.Number.System.html#numeric_systems/0"><code class="inline">Cldr.Number.System.numeric_systems/0</code></a>.</p><p>If a transliteration is requested between two number pairs that have not been configured for
|
||||
precompilation, a warning is logged.</p>
|
||||
</section>
|
||||
@ -281,22 +281,22 @@ and <a href="Plausible.Cldr.Number.System.html#number_systems_for/1"><code class
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="9359763122-1">(</span><span class="s">"123556"</span><span class="p" data-group-id="9359763122-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="6078721009-1">(</span><span class="s">"123556"</span><span class="p" data-group-id="6078721009-1">)</span><span class="w">
|
||||
</span><span class="s">"123556"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="9359763122-2">(</span><span class="s">"123,556.000"</span><span class="p">,</span><span class="w"> </span><span class="s">"fr"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="p" data-group-id="9359763122-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="6078721009-2">(</span><span class="s">"123,556.000"</span><span class="p">,</span><span class="w"> </span><span class="s">"fr"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="p" data-group-id="6078721009-2">)</span><span class="w">
|
||||
</span><span class="s">"123 556,000"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="9359763122-3">(</span><span class="s">"123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="p" data-group-id="9359763122-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="6078721009-3">(</span><span class="s">"123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="p" data-group-id="6078721009-3">)</span><span class="w">
|
||||
</span><span class="s">"123556"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="9359763122-4">(</span><span class="s">"123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="s">"thai"</span><span class="p" data-group-id="9359763122-4">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="6078721009-4">(</span><span class="s">"123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="s">"thai"</span><span class="p" data-group-id="6078721009-4">)</span><span class="w">
|
||||
</span><span class="s">"๑๒๓๕๕๖"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="9359763122-5">(</span><span class="s">"123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="ss">:native</span><span class="p" data-group-id="9359763122-5">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="6078721009-5">(</span><span class="s">"123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="ss">:native</span><span class="p" data-group-id="6078721009-5">)</span><span class="w">
|
||||
</span><span class="s">"๑๒๓๕๕๖"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="9359763122-6">(</span><span class="s">"Some number is: 123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="s">"thai"</span><span class="p" data-group-id="9359763122-6">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number.Transliterate</span><span class="o">.</span><span class="n">transliterate</span><span class="p" data-group-id="6078721009-6">(</span><span class="s">"Some number is: 123556"</span><span class="p">,</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="s">"thai"</span><span class="p" data-group-id="6078721009-6">)</span><span class="w">
|
||||
</span><span class="s">"Some number is: ๑๒๓๕๕๖"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -441,19 +441,19 @@ using the Elixir standard library functions.</p><h2 id="parse/2-examples" class=
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="0561814627-1">(</span><span class="s">"+1.000,34"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p" data-group-id="0561814627-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0561814627-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="mf">1000.34</span><span class="p" data-group-id="0561814627-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="1042484082-1">(</span><span class="s">"+1.000,34"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p" data-group-id="1042484082-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1042484082-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="mf">1000.34</span><span class="p" data-group-id="1042484082-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="0561814627-3">(</span><span class="s">"-1_000_000.34"</span><span class="p" data-group-id="0561814627-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0561814627-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mf">1000000.34</span><span class="p" data-group-id="0561814627-4">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="1042484082-3">(</span><span class="s">"-1_000_000.34"</span><span class="p" data-group-id="1042484082-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1042484082-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mf">1000000.34</span><span class="p" data-group-id="1042484082-4">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="0561814627-5">(</span><span class="s">"1.000"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p">,</span><span class="w"> </span><span class="ss">number</span><span class="p">:</span><span class="w"> </span><span class="ss">:integer</span><span class="p" data-group-id="0561814627-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0561814627-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="mi">1000</span><span class="p" data-group-id="0561814627-6">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="1042484082-5">(</span><span class="s">"1.000"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p">,</span><span class="w"> </span><span class="ss">number</span><span class="p">:</span><span class="w"> </span><span class="ss">:integer</span><span class="p" data-group-id="1042484082-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1042484082-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="mi">1000</span><span class="p" data-group-id="1042484082-6">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="0561814627-7">(</span><span class="s">"+1.000,34"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p">,</span><span class="w"> </span><span class="ss">number</span><span class="p">:</span><span class="w"> </span><span class="ss">:integer</span><span class="p" data-group-id="0561814627-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0561814627-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0561814627-9">{</span><span class="nc">Cldr.Number.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The string </span><span class="se">\"</span><span class="s">+1.000,34</span><span class="se">\"</span><span class="s"> could not be parsed as a number"</span><span class="p" data-group-id="0561814627-9">}</span><span class="p" data-group-id="0561814627-8">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">parse</span><span class="p" data-group-id="1042484082-7">(</span><span class="s">"+1.000,34"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p">,</span><span class="w"> </span><span class="ss">number</span><span class="p">:</span><span class="w"> </span><span class="ss">:integer</span><span class="p" data-group-id="1042484082-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1042484082-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="1042484082-9">{</span><span class="nc">Cldr.Number.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The string </span><span class="se">\"</span><span class="s">+1.000,34</span><span class="se">\"</span><span class="s"> could not be parsed as a number"</span><span class="p" data-group-id="1042484082-9">}</span><span class="p" data-group-id="1042484082-8">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="resolve_currencies/2">
|
||||
@ -525,17 +525,17 @@ financial instruments.</p></li></ul><h2 id="resolve_currencies/2-examples" class
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="5595103953-1">(</span><span class="s">"100 US dollars"</span><span class="p" data-group-id="5595103953-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="7477832318-1">(</span><span class="s">"100 US dollars"</span><span class="p" data-group-id="7477832318-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currencies</span><span class="w">
|
||||
</span><span class="p" data-group-id="5595103953-2">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="5595103953-2">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="7477832318-2">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="7477832318-2">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="5595103953-3">(</span><span class="s">"100 eurosports"</span><span class="p" data-group-id="5595103953-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currencies</span><span class="p" data-group-id="5595103953-4">(</span><span class="ss">fuzzy</span><span class="p">:</span><span class="w"> </span><span class="mf">0.75</span><span class="p" data-group-id="5595103953-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5595103953-5">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:EUR</span><span class="p" data-group-id="5595103953-5">]</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="7477832318-3">(</span><span class="s">"100 eurosports"</span><span class="p" data-group-id="7477832318-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currencies</span><span class="p" data-group-id="7477832318-4">(</span><span class="ss">fuzzy</span><span class="p">:</span><span class="w"> </span><span class="mf">0.75</span><span class="p" data-group-id="7477832318-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7477832318-5">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:EUR</span><span class="p" data-group-id="7477832318-5">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="5595103953-6">(</span><span class="s">"100 dollars des États-Unis"</span><span class="p" data-group-id="5595103953-6">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currencies</span><span class="p" data-group-id="5595103953-7">(</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="5595103953-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5595103953-8">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="5595103953-8">]</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="7477832318-6">(</span><span class="s">"100 dollars des États-Unis"</span><span class="p" data-group-id="7477832318-6">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currencies</span><span class="p" data-group-id="7477832318-7">(</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="7477832318-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7477832318-8">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:USD</span><span class="p" data-group-id="7477832318-8">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="resolve_currency/2">
|
||||
@ -612,19 +612,19 @@ financial instruments.</p></li></ul><h2 id="resolve_currency/2-examples" class="
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="5829950907-1">(</span><span class="s">"US dollars"</span><span class="p" data-group-id="5829950907-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5829950907-2">[</span><span class="ss">:USD</span><span class="p" data-group-id="5829950907-2">]</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="6455226421-1">(</span><span class="s">"US dollars"</span><span class="p" data-group-id="6455226421-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6455226421-2">[</span><span class="ss">:USD</span><span class="p" data-group-id="6455226421-2">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="5829950907-3">(</span><span class="s">"100 eurosports"</span><span class="p">,</span><span class="w"> </span><span class="ss">fuzzy</span><span class="p">:</span><span class="w"> </span><span class="mf">0.75</span><span class="p" data-group-id="5829950907-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5829950907-4">[</span><span class="ss">:EUR</span><span class="p" data-group-id="5829950907-4">]</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="6455226421-3">(</span><span class="s">"100 eurosports"</span><span class="p">,</span><span class="w"> </span><span class="ss">fuzzy</span><span class="p">:</span><span class="w"> </span><span class="mf">0.75</span><span class="p" data-group-id="6455226421-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6455226421-4">[</span><span class="ss">:EUR</span><span class="p" data-group-id="6455226421-4">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="5829950907-5">(</span><span class="s">"dollars des États-Unis"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="5829950907-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5829950907-6">[</span><span class="ss">:USD</span><span class="p" data-group-id="5829950907-6">]</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="6455226421-5">(</span><span class="s">"dollars des États-Unis"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="6455226421-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6455226421-6">[</span><span class="ss">:USD</span><span class="p" data-group-id="6455226421-6">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="5829950907-7">(</span><span class="s">"not a known currency"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="5829950907-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5829950907-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="5829950907-9">{</span><span class="nc">Cldr.UnknownCurrencyError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The currency </span><span class="se">\"</span><span class="s">not a known currency</span><span class="se">\"</span><span class="s"> is unknown or not supported"</span><span class="p" data-group-id="5829950907-9">}</span><span class="p" data-group-id="5829950907-8">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_currency</span><span class="p" data-group-id="6455226421-7">(</span><span class="s">"not a known currency"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="p" data-group-id="6455226421-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6455226421-8">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6455226421-9">{</span><span class="nc">Cldr.UnknownCurrencyError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The currency </span><span class="se">\"</span><span class="s">not a known currency</span><span class="se">\"</span><span class="s"> is unknown or not supported"</span><span class="p" data-group-id="6455226421-9">}</span><span class="p" data-group-id="6455226421-8">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="resolve_per/2">
|
||||
@ -688,13 +688,13 @@ The default is <code class="inline">options[:backend].get_locale()</code></li></
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_per</span><span class="w"> </span><span class="s">"11%"</span><span class="w">
|
||||
</span><span class="p" data-group-id="8561216004-1">[</span><span class="s">"11"</span><span class="p">,</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="8561216004-1">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8549778986-1">[</span><span class="s">"11"</span><span class="p">,</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="8549778986-1">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_per</span><span class="w"> </span><span class="s">"% of linguists"</span><span class="w">
|
||||
</span><span class="p" data-group-id="8561216004-2">[</span><span class="ss">:percent</span><span class="p">,</span><span class="w"> </span><span class="s">" of linguists"</span><span class="p" data-group-id="8561216004-2">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8549778986-2">[</span><span class="ss">:percent</span><span class="p">,</span><span class="w"> </span><span class="s">" of linguists"</span><span class="p" data-group-id="8549778986-2">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_per</span><span class="w"> </span><span class="s">"% of linguists %"</span><span class="w">
|
||||
</span><span class="p" data-group-id="8561216004-3">[</span><span class="ss">:percent</span><span class="p">,</span><span class="w"> </span><span class="s">" of linguists "</span><span class="p">,</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="8561216004-3">]</span></code></pre>
|
||||
</span><span class="p" data-group-id="8549778986-3">[</span><span class="ss">:percent</span><span class="p">,</span><span class="w"> </span><span class="s">" of linguists "</span><span class="p">,</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="8549778986-3">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="resolve_pers/2">
|
||||
@ -751,9 +751,9 @@ The default is <code class="inline">options[:backend].get_locale()</code></li></
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="6942596564-1">(</span><span class="s">"100%"</span><span class="p" data-group-id="6942596564-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_pers</span><span class="p" data-group-id="6942596564-2">(</span><span class="p" data-group-id="6942596564-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6942596564-3">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="6942596564-3">]</span></code></pre>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="8470470533-1">(</span><span class="s">"100%"</span><span class="p" data-group-id="8470470533-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">resolve_pers</span><span class="p" data-group-id="8470470533-2">(</span><span class="p" data-group-id="8470470533-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8470470533-3">[</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="8470470533-3">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="scan/2">
|
||||
@ -813,20 +813,20 @@ and any options provided are passed to that function.</p><h2 id="scan/2-examples
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="3647554826-1">(</span><span class="s">"£1_000_000.34"</span><span class="p" data-group-id="3647554826-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3647554826-2">[</span><span class="s">"£"</span><span class="p">,</span><span class="w"> </span><span class="mf">1000000.34</span><span class="p" data-group-id="3647554826-2">]</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="8761022538-1">(</span><span class="s">"£1_000_000.34"</span><span class="p" data-group-id="8761022538-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8761022538-2">[</span><span class="s">"£"</span><span class="p">,</span><span class="w"> </span><span class="mf">1000000.34</span><span class="p" data-group-id="8761022538-2">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="3647554826-3">(</span><span class="s">"I want £1_000_000 dollars"</span><span class="p" data-group-id="3647554826-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3647554826-4">[</span><span class="s">"I want £"</span><span class="p">,</span><span class="w"> </span><span class="mi">1000000</span><span class="p">,</span><span class="w"> </span><span class="s">" dollars"</span><span class="p" data-group-id="3647554826-4">]</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="8761022538-3">(</span><span class="s">"I want £1_000_000 dollars"</span><span class="p" data-group-id="8761022538-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8761022538-4">[</span><span class="s">"I want £"</span><span class="p">,</span><span class="w"> </span><span class="mi">1000000</span><span class="p">,</span><span class="w"> </span><span class="s">" dollars"</span><span class="p" data-group-id="8761022538-4">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="3647554826-5">(</span><span class="s">"The prize is 23"</span><span class="p" data-group-id="3647554826-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3647554826-6">[</span><span class="s">"The prize is "</span><span class="p">,</span><span class="w"> </span><span class="mi">23</span><span class="p" data-group-id="3647554826-6">]</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="8761022538-5">(</span><span class="s">"The prize is 23"</span><span class="p" data-group-id="8761022538-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8761022538-6">[</span><span class="s">"The prize is "</span><span class="p">,</span><span class="w"> </span><span class="mi">23</span><span class="p" data-group-id="8761022538-6">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="3647554826-7">(</span><span class="s">"The lottery number is 23 for the next draw"</span><span class="p" data-group-id="3647554826-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3647554826-8">[</span><span class="s">"The lottery number is "</span><span class="p">,</span><span class="w"> </span><span class="mi">23</span><span class="p">,</span><span class="w"> </span><span class="s">" for the next draw"</span><span class="p" data-group-id="3647554826-8">]</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="8761022538-7">(</span><span class="s">"The lottery number is 23 for the next draw"</span><span class="p" data-group-id="8761022538-7">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8761022538-8">[</span><span class="s">"The lottery number is "</span><span class="p">,</span><span class="w"> </span><span class="mi">23</span><span class="p">,</span><span class="w"> </span><span class="s">" for the next draw"</span><span class="p" data-group-id="8761022538-8">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="3647554826-9">(</span><span class="s">"The loss is -1.000 euros"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p">,</span><span class="w"> </span><span class="ss">number</span><span class="p">:</span><span class="w"> </span><span class="ss">:integer</span><span class="p" data-group-id="3647554826-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3647554826-10">[</span><span class="s">"The loss is "</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mi">1000</span><span class="p">,</span><span class="w"> </span><span class="s">" euros"</span><span class="p" data-group-id="3647554826-10">]</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">scan</span><span class="p" data-group-id="8761022538-9">(</span><span class="s">"The loss is -1.000 euros"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"de"</span><span class="p">,</span><span class="w"> </span><span class="ss">number</span><span class="p">:</span><span class="w"> </span><span class="ss">:integer</span><span class="p" data-group-id="8761022538-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8761022538-10">[</span><span class="s">"The loss is "</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mi">1000</span><span class="p">,</span><span class="w"> </span><span class="s">" euros"</span><span class="p" data-group-id="8761022538-10">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_approx_string/2">
|
||||
@ -873,7 +873,7 @@ options.</p></li></ul><h2 id="to_approx_string/2-example" class="section-heading
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_approx_string</span><span class="w"> </span><span class="mi">1234</span><span class="w">
|
||||
</span><span class="p" data-group-id="7954910932-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"~1,234"</span><span class="p" data-group-id="7954910932-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="4435432656-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"~1,234"</span><span class="p" data-group-id="4435432656-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_at_least_string/2">
|
||||
@ -920,7 +920,7 @@ options.</p></li></ul><h2 id="to_at_least_string/2-example" class="section-headi
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_at_least_string</span><span class="w"> </span><span class="mi">1234</span><span class="w">
|
||||
</span><span class="p" data-group-id="5414914518-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1,234+"</span><span class="p" data-group-id="5414914518-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="0174764787-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1,234+"</span><span class="p" data-group-id="0174764787-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_at_most_string/2">
|
||||
@ -967,7 +967,7 @@ options.</p></li></ul><h2 id="to_at_most_string/2-example" class="section-headin
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_at_most_string</span><span class="w"> </span><span class="mi">1234</span><span class="w">
|
||||
</span><span class="p" data-group-id="2861113152-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"≤1,234"</span><span class="p" data-group-id="2861113152-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="1440842569-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"≤1,234"</span><span class="p" data-group-id="1440842569-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_range_string/2">
|
||||
@ -1014,7 +1014,7 @@ options.</p></li></ul><h2 id="to_range_string/2-example" class="section-heading"
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_range_string</span><span class="w"> </span><span class="mi">1234</span><span class="o">..</span><span class="mi">5678</span><span class="w">
|
||||
</span><span class="p" data-group-id="5829453095-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1,234–5,678"</span><span class="p" data-group-id="5829453095-1">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="8122478898-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1,234–5,678"</span><span class="p" data-group-id="8122478898-1">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_string/2">
|
||||
@ -1133,21 +1133,21 @@ extensions.</p><h2 id="to_string/2-wrapping-format-elements" class="section-head
|
||||
</h2>
|
||||
<p>Wrapping elements is particularly useful when formatting a number with a
|
||||
currency symbol and the requirement is to have different HTML formatting
|
||||
applied to the symbol than the number. For example:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="7153750361-1">(</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:currency</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">wrapper</span><span class="p">:</span><span class="w"> </span><span class="k" data-group-id="7153750361-2">fn</span><span class="w">
|
||||
applied to the symbol than the number. For example:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="8894803630-1">(</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:currency</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">wrapper</span><span class="p">:</span><span class="w"> </span><span class="k" data-group-id="8894803630-2">fn</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:currency_symbol</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="s">"<span class=</span><span class="se">\"</span><span class="s">symbol</span><span class="se">\"</span><span class="s">>"</span><span class="w"> </span><span class="o"><></span><span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="o"><></span><span class="w"> </span><span class="s">"</span>"</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:number</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="s">"<span class=</span><span class="se">\"</span><span class="s">number</span><span class="se">\"</span><span class="s">>"</span><span class="w"> </span><span class="o"><></span><span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="o"><></span><span class="w"> </span><span class="s">"</span>"</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:currency_space</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="s">"<span>"</span><span class="w"> </span><span class="o"><></span><span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="o"><></span><span class="w"> </span><span class="s">"</span>"</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="c">_other</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="n">string</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="k" data-group-id="7153750361-2">end</span><span class="p" data-group-id="7153750361-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7153750361-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"<span class=</span><span class="se">\"</span><span class="s">symbol</span><span class="se">\"</span><span class="s">>$</span><span class=</span><span class="se">\"</span><span class="s">number</span><span class="se">\"</span><span class="s">>100.00</span>"</span><span class="p" data-group-id="7153750361-3">}</span></code></pre><p>It is also possible and recommended to use the <a href="https://hexdocs.pm/phoenix_html/3.3.3/Phoenix.HTML.Tag.html#content_tag/3"><code class="inline">Phoenix.HTML.Tag.content_tag/3</code></a>
|
||||
</span><span class="gp unselectable">...> </span><span class="k" data-group-id="8894803630-2">end</span><span class="p" data-group-id="8894803630-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8894803630-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"<span class=</span><span class="se">\"</span><span class="s">symbol</span><span class="se">\"</span><span class="s">>$</span><span class=</span><span class="se">\"</span><span class="s">number</span><span class="se">\"</span><span class="s">>100.00</span>"</span><span class="p" data-group-id="8894803630-3">}</span></code></pre><p>It is also possible and recommended to use the <a href="https://hexdocs.pm/phoenix_html/3.3.3/Phoenix.HTML.Tag.html#content_tag/3"><code class="inline">Phoenix.HTML.Tag.content_tag/3</code></a>
|
||||
function if wrapping HTML tags since these will ensure HTML entities are
|
||||
correctly encoded. For example:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="8191482604-1">(</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:currency</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">wrapper</span><span class="p">:</span><span class="w"> </span><span class="k" data-group-id="8191482604-2">fn</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:currency_symbol</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="nc">Phoenix.HTML.Tag</span><span class="o">.</span><span class="n">content_tag</span><span class="p" data-group-id="8191482604-3">(</span><span class="ss">:span</span><span class="p">,</span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">class</span><span class="p">:</span><span class="w"> </span><span class="s">"symbol"</span><span class="p" data-group-id="8191482604-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:number</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="nc">Phoenix.HTML.Tag</span><span class="o">.</span><span class="n">content_tag</span><span class="p" data-group-id="8191482604-4">(</span><span class="ss">:span</span><span class="p">,</span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">class</span><span class="p">:</span><span class="w"> </span><span class="s">"number"</span><span class="p" data-group-id="8191482604-4">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:currency_space</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="nc">Phoenix.HTML.Tag</span><span class="o">.</span><span class="n">content_tag</span><span class="p" data-group-id="8191482604-5">(</span><span class="ss">:span</span><span class="p">,</span><span class="w"> </span><span class="n">string</span><span class="p" data-group-id="8191482604-5">)</span><span class="w">
|
||||
correctly encoded. For example:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="3333616521-1">(</span><span class="mi">100</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:currency</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="ss">:USD</span><span class="p">,</span><span class="w"> </span><span class="ss">wrapper</span><span class="p">:</span><span class="w"> </span><span class="k" data-group-id="3333616521-2">fn</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:currency_symbol</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="nc">Phoenix.HTML.Tag</span><span class="o">.</span><span class="n">content_tag</span><span class="p" data-group-id="3333616521-3">(</span><span class="ss">:span</span><span class="p">,</span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">class</span><span class="p">:</span><span class="w"> </span><span class="s">"symbol"</span><span class="p" data-group-id="3333616521-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:number</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="nc">Phoenix.HTML.Tag</span><span class="o">.</span><span class="n">content_tag</span><span class="p" data-group-id="3333616521-4">(</span><span class="ss">:span</span><span class="p">,</span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">class</span><span class="p">:</span><span class="w"> </span><span class="s">"number"</span><span class="p" data-group-id="3333616521-4">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="ss">:currency_space</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="nc">Phoenix.HTML.Tag</span><span class="o">.</span><span class="n">content_tag</span><span class="p" data-group-id="3333616521-5">(</span><span class="ss">:span</span><span class="p">,</span><span class="w"> </span><span class="n">string</span><span class="p" data-group-id="3333616521-5">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="n">string</span><span class="p">,</span><span class="w"> </span><span class="c">_other</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="n">string</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="k" data-group-id="8191482604-2">end</span><span class="p" data-group-id="8191482604-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8191482604-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"<span class=</span><span class="se">\"</span><span class="s">symbol</span><span class="se">\"</span><span class="s">>$</span><span class=</span><span class="se">\"</span><span class="s">number</span><span class="se">\"</span><span class="s">>100.00</span>"</span><span class="p" data-group-id="8191482604-6">}</span></code></pre><p>When formatting a number the format is parsed into format elements that might include
|
||||
</span><span class="gp unselectable">...> </span><span class="k" data-group-id="3333616521-2">end</span><span class="p" data-group-id="3333616521-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3333616521-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"<span class=</span><span class="se">\"</span><span class="s">symbol</span><span class="se">\"</span><span class="s">>$</span><span class=</span><span class="se">\"</span><span class="s">number</span><span class="se">\"</span><span class="s">>100.00</span>"</span><span class="p" data-group-id="3333616521-6">}</span></code></pre><p>When formatting a number the format is parsed into format elements that might include
|
||||
a currency symbol, a literal string, inserted text between a currency symbol and the
|
||||
currency amount, a percent sign, the number itself and several other elements. In
|
||||
some cases it is helpful to be apply specific formatting to each element.
|
||||
@ -1168,80 +1168,80 @@ inserted in the final formatted number.</p><h2 id="to_string/2-returns" class="s
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"12,345"</span><span class="p" data-group-id="3029769742-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"12,345"</span><span class="p" data-group-id="1092110242-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"12 345"</span><span class="p" data-group-id="3029769742-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"12 345"</span><span class="p" data-group-id="1092110242-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mf">1345.32</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="ss">:EUR</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"es"</span><span class="p">,</span><span class="w"> </span><span class="ss">minimum_grouping_digits</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1.345,32 €"</span><span class="p" data-group-id="3029769742-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1.345,32 €"</span><span class="p" data-group-id="1092110242-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mf">1345.32</span><span class="p">,</span><span class="w"> </span><span class="ss">currency</span><span class="p">:</span><span class="w"> </span><span class="ss">:EUR</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"es"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1345,32 €"</span><span class="p" data-group-id="3029769742-4">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1345,32 €"</span><span class="p" data-group-id="1092110242-4">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"fr"</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">"USD"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"12 345,00 $US"</span><span class="p" data-group-id="3029769742-5">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-5">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"12 345,00 $US"</span><span class="p" data-group-id="1092110242-5">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="s">"#E0"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1.2345E4"</span><span class="p" data-group-id="3029769742-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-6">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1.2345E4"</span><span class="p" data-group-id="1092110242-6">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:accounting</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">"THB"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-7">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"THB 12,345.00"</span><span class="p" data-group-id="3029769742-7">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-7">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"THB 12,345.00"</span><span class="p" data-group-id="1092110242-7">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="o">-</span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:accounting</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">"THB"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-8">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"(THB 12,345.00)"</span><span class="p" data-group-id="3029769742-8">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-8">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"(THB 12,345.00)"</span><span class="p" data-group-id="1092110242-8">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:accounting</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">"THB"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"th"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-9">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"฿12,345.00"</span><span class="p" data-group-id="3029769742-9">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-9">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"฿12,345.00"</span><span class="p" data-group-id="1092110242-9">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:accounting</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">"THB"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"th"</span><span class="p">,</span><span class="w"> </span><span class="ss">number_system</span><span class="p">:</span><span class="w"> </span><span class="ss">:native</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"฿๑๒,๓๔๕.๐๐"</span><span class="p" data-group-id="3029769742-10">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"฿๑๒,๓๔๕.๐๐"</span><span class="p" data-group-id="1092110242-10">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mf">1244.30</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:long</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1 thousand"</span><span class="p" data-group-id="3029769742-11">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-11">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1 thousand"</span><span class="p" data-group-id="1092110242-11">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mf">1244.30</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:long</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">"USD"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-12">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1,244 US dollars"</span><span class="p" data-group-id="3029769742-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-12">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1,244 US dollars"</span><span class="p" data-group-id="1092110242-12">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mf">1244.30</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:short</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-13">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1K"</span><span class="p" data-group-id="3029769742-13">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-13">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"1K"</span><span class="p" data-group-id="1092110242-13">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mf">1244.30</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:short</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">"EUR"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-14">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"€1K"</span><span class="p" data-group-id="3029769742-14">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-14">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"€1K"</span><span class="p" data-group-id="1092110242-14">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">1234</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:spellout</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-15">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"one thousand two hundred thirty-four"</span><span class="p" data-group-id="3029769742-15">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-15">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"one thousand two hundred thirty-four"</span><span class="p" data-group-id="1092110242-15">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">1234</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:spellout_verbose</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-16">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"one thousand two hundred and thirty-four"</span><span class="p" data-group-id="3029769742-16">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-16">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"one thousand two hundred and thirty-four"</span><span class="p" data-group-id="1092110242-16">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">1989</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:spellout_year</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-17">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"nineteen eighty-nine"</span><span class="p" data-group-id="3029769742-17">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-17">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"nineteen eighty-nine"</span><span class="p" data-group-id="1092110242-17">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:ordinal</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-18">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"123rd"</span><span class="p" data-group-id="3029769742-18">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-18">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"123rd"</span><span class="p" data-group-id="1092110242-18">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:roman</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-19">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"CXXIII"</span><span class="p" data-group-id="3029769742-19">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="1092110242-19">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"CXXIII"</span><span class="p" data-group-id="1092110242-19">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"th-u-nu-thai"</span><span class="w">
|
||||
</span><span class="p" data-group-id="3029769742-20">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"๑๒๓"</span><span class="p" data-group-id="3029769742-20">}</span></code></pre><h2 id="to_string/2-errors" class="section-heading">
|
||||
</span><span class="p" data-group-id="1092110242-20">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"๑๒๓"</span><span class="p" data-group-id="1092110242-20">}</span></code></pre><h2 id="to_string/2-errors" class="section-heading">
|
||||
<a href="#to_string/2-errors" class="hover-link">
|
||||
<i class="ri-link-m" aria-hidden="true"></i>
|
||||
</a>
|
||||
<span class="text">Errors</span>
|
||||
</h2>
|
||||
<p>An error tuple <code class="inline">{:error, reason}</code> will be returned if an error is detected.
|
||||
The two most likely causes of an error return are:</p><ul><li>A format cannot be compiled. In this case the error tuple will look like:</li></ul><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="4356192464-1">(</span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="s">"0#"</span><span class="p" data-group-id="4356192464-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4356192464-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="4356192464-3">{</span><span class="nc">Cldr.FormatCompileError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Decimal format compiler: syntax error before: </span><span class="se">\"</span><span class="s">#</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="4356192464-3">}</span><span class="p" data-group-id="4356192464-2">}</span></code></pre><ul><li>The format style requested is not defined for the <code class="inline">locale</code> and
|
||||
The two most likely causes of an error return are:</p><ul><li>A format cannot be compiled. In this case the error tuple will look like:</li></ul><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="3275727930-1">(</span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="s">"0#"</span><span class="p" data-group-id="3275727930-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3275727930-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3275727930-3">{</span><span class="nc">Cldr.FormatCompileError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Decimal format compiler: syntax error before: </span><span class="se">\"</span><span class="s">#</span><span class="se">\"</span><span class="s">"</span><span class="p" data-group-id="3275727930-3">}</span><span class="p" data-group-id="3275727930-2">}</span></code></pre><ul><li>The format style requested is not defined for the <code class="inline">locale</code> and
|
||||
<code class="inline">number_system</code>. This happens typically when the number system is
|
||||
<code class="inline">:algorithmic</code> rather than the more common <code class="inline">:numeric</code>. In this case the error
|
||||
return looks like:</li></ul><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="9696243335-1">(</span><span class="mi">1234</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"he"</span><span class="p">,</span><span class="w"> </span><span class="ss">number_system</span><span class="p">:</span><span class="w"> </span><span class="s">"hebr"</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="9696243335-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9696243335-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="9696243335-3">{</span><span class="nc">Cldr.UnknownFormatError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The locale :he with number system :hebr does not define a format :percent"</span><span class="p" data-group-id="9696243335-3">}</span><span class="p" data-group-id="9696243335-2">}</span></code></pre>
|
||||
return looks like:</li></ul><pre><code class="makeup elixir" translate="no"><span class="w"> </span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="1544154864-1">(</span><span class="mi">1234</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="s">"he"</span><span class="p">,</span><span class="w"> </span><span class="ss">number_system</span><span class="p">:</span><span class="w"> </span><span class="s">"hebr"</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:percent</span><span class="p" data-group-id="1544154864-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1544154864-2">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1544154864-3">{</span><span class="nc">Cldr.UnknownFormatError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"The locale :he with number system :hebr does not define a format :percent"</span><span class="p" data-group-id="1544154864-3">}</span><span class="p" data-group-id="1544154864-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="to_string!/2">
|
||||
@ -1346,17 +1346,17 @@ returned by <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.html#known_number_sy
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">validate_number_system</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="w">
|
||||
</span><span class="p" data-group-id="3717996555-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="3717996555-1">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8249942561-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="8249942561-1">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">validate_number_system</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="w">
|
||||
</span><span class="p" data-group-id="3717996555-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="3717996555-2">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8249942561-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:latn</span><span class="p" data-group-id="8249942561-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">validate_number_system</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w"> </span><span class="ss">:unknown</span><span class="w">
|
||||
</span><span class="p" data-group-id="3717996555-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="3717996555-4">{</span><span class="nc">Cldr.UnknownNumberSystemError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system :unknown is unknown"</span><span class="p" data-group-id="3717996555-4">}</span><span class="p" data-group-id="3717996555-3">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="8249942561-3">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8249942561-4">{</span><span class="nc">Cldr.UnknownNumberSystemError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system :unknown is unknown"</span><span class="p" data-group-id="8249942561-4">}</span><span class="p" data-group-id="8249942561-3">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">validate_number_system</span><span class="w"> </span><span class="s">"zz"</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="w">
|
||||
</span><span class="p" data-group-id="3717996555-5">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3717996555-6">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="3717996555-6">}</span><span class="p" data-group-id="3717996555-5">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="8249942561-5">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8249942561-6">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="8249942561-6">}</span><span class="p" data-group-id="8249942561-5">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -145,9 +145,9 @@ Pages
|
||||
<section id="moduledoc">
|
||||
<p>Functions to implement the number system rule-based-number-format rules of CLDR.</p><p>These rules are defined only on the "und" locale and represent specialised
|
||||
number formatting.</p><p>The standard public API for RBNF is via the <a href="https://hexdocs.pm/ex_cldr_numbers/2.32.3/Cldr.Number.html#to_string/2"><code class="inline">Cldr.Number.to_string/2</code></a> function.</p><p>The functions on this module are defined at compile time based upon the RBNF rules
|
||||
defined in the Unicode CLDR data repository. Available rules are identified by:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.NumberSystem</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="4235781460-1">(</span><span class="ss">:und</span><span class="p" data-group-id="4235781460-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Enum</span><span class="o">.</span><span class="n">sort</span><span class="p" data-group-id="4235781460-2">(</span><span class="p" data-group-id="4235781460-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4235781460-3">[</span><span class="w">
|
||||
defined in the Unicode CLDR data repository. Available rules are identified by:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.NumberSystem</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="3261622166-1">(</span><span class="ss">:und</span><span class="p" data-group-id="3261622166-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Enum</span><span class="o">.</span><span class="n">sort</span><span class="p" data-group-id="3261622166-2">(</span><span class="p" data-group-id="3261622166-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3261622166-3">[</span><span class="w">
|
||||
</span><span class="ss">:armenian_lower</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:armenian_upper</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:cyrillic_lower</span><span class="p">,</span><span class="w">
|
||||
@ -161,9 +161,9 @@ defined in the Unicode CLDR data repository. Available rules are identified by:
|
||||
</span><span class="ss">:roman_upper</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:tamil</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:zz_default</span><span class="w">
|
||||
</span><span class="p" data-group-id="4235781460-3">]</span></code></pre><p>A rule can then be invoked on an available rule_set. For example</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.NumberSystem</span><span class="o">.</span><span class="n">roman_upper</span><span class="p" data-group-id="2773955007-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:und</span><span class="p" data-group-id="2773955007-1">)</span><span class="w">
|
||||
</span><span class="s">"CXXIII"</span></code></pre><p>This particular call is equivalent to the call through the public API of:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="8558774278-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:roman</span><span class="p" data-group-id="8558774278-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8558774278-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"CXXIII"</span><span class="p" data-group-id="8558774278-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="3261622166-3">]</span></code></pre><p>A rule can then be invoked on an available rule_set. For example</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.NumberSystem</span><span class="o">.</span><span class="n">roman_upper</span><span class="p" data-group-id="7612386057-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:und</span><span class="p" data-group-id="7612386057-1">)</span><span class="w">
|
||||
</span><span class="s">"CXXIII"</span></code></pre><p>This particular call is equivalent to the call through the public API of:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="1618353775-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:roman</span><span class="p" data-group-id="1618353775-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="1618353775-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"CXXIII"</span><span class="p" data-group-id="1618353775-2">}</span></code></pre>
|
||||
</section>
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -145,20 +145,20 @@ Pages
|
||||
<section id="moduledoc">
|
||||
<p>Functions to implement the ordinal rule-based-number-format rules of CLDR.</p><p>As CLDR notes, the data is incomplete or non-existent for many languages. It
|
||||
is considered complete for English however.</p><p>The standard public API for RBNF is via the <a href="https://hexdocs.pm/ex_cldr_numbers/2.32.3/Cldr.Number.html#to_string/2"><code class="inline">Cldr.Number.to_string/2</code></a> function.</p><p>The functions on this module are defined at compile time based upon the RBNF rules
|
||||
defined in the Unicode CLDR data repository. Available rules are identified by:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Ordinal</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="3738725100-1">(</span><span class="ss">:en</span><span class="p" data-group-id="3738725100-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3738725100-2">[</span><span class="ss">:digits_ordinal</span><span class="p" data-group-id="3738725100-2">]</span><span class="w">
|
||||
defined in the Unicode CLDR data repository. Available rules are identified by:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Ordinal</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="9571209324-1">(</span><span class="ss">:en</span><span class="p" data-group-id="9571209324-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9571209324-2">[</span><span class="ss">:digits_ordinal</span><span class="p" data-group-id="9571209324-2">]</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Ordinal</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="3738725100-3">(</span><span class="s">"fr"</span><span class="p" data-group-id="3738725100-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Enum</span><span class="o">.</span><span class="n">sort</span><span class="p" data-group-id="3738725100-4">(</span><span class="p" data-group-id="3738725100-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3738725100-5">[</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Ordinal</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="9571209324-3">(</span><span class="s">"fr"</span><span class="p" data-group-id="9571209324-3">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Enum</span><span class="o">.</span><span class="n">sort</span><span class="p" data-group-id="9571209324-4">(</span><span class="p" data-group-id="9571209324-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9571209324-5">[</span><span class="w">
|
||||
</span><span class="ss">:digits_ordinal</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:digits_ordinal_feminine</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:digits_ordinal_feminine_plural</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:digits_ordinal_masculine</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:digits_ordinal_masculine_plural</span><span class="w">
|
||||
</span><span class="p" data-group-id="3738725100-5">]</span></code></pre><p>A rule can then be invoked on an available rule_set. For example</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Ordinal</span><span class="o">.</span><span class="n">digits_ordinal</span><span class="p" data-group-id="1395919944-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p" data-group-id="1395919944-1">)</span><span class="w">
|
||||
</span><span class="s">"123rd"</span></code></pre><p>This call is equivalent to the call through the public API of:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="6746656712-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:ordinal</span><span class="p" data-group-id="6746656712-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6746656712-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"123rd"</span><span class="p" data-group-id="6746656712-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="9571209324-5">]</span></code></pre><p>A rule can then be invoked on an available rule_set. For example</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Ordinal</span><span class="o">.</span><span class="n">digits_ordinal</span><span class="p" data-group-id="7466246178-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">:en</span><span class="p" data-group-id="7466246178-1">)</span><span class="w">
|
||||
</span><span class="s">"123rd"</span></code></pre><p>This call is equivalent to the call through the public API of:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="4200436118-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:ordinal</span><span class="p" data-group-id="4200436118-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4200436118-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"123rd"</span><span class="p" data-group-id="4200436118-2">}</span></code></pre>
|
||||
</section>
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -145,9 +145,9 @@ Pages
|
||||
<section id="moduledoc">
|
||||
<p>Functions to implement the spellout rule-based-number-format rules of CLDR.</p><p>As CLDR notes, the data is incomplete or non-existent for many languages. It
|
||||
is considered complete for English however.</p><p>The standard public API for RBNF is via the <a href="https://hexdocs.pm/ex_cldr_numbers/2.32.3/Cldr.Number.html#to_string/2"><code class="inline">Cldr.Number.to_string/2</code></a> function.</p><p>The functions on this module are defined at compile time based upon the RBNF rules
|
||||
defined in the Unicode CLDR data repository. Available rules are identified by:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Spellout</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="4618678770-1">(</span><span class="s">"en"</span><span class="p" data-group-id="4618678770-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Enum</span><span class="o">.</span><span class="n">sort</span><span class="p" data-group-id="4618678770-2">(</span><span class="p" data-group-id="4618678770-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4618678770-3">[</span><span class="w">
|
||||
defined in the Unicode CLDR data repository. Available rules are identified by:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Spellout</span><span class="o">.</span><span class="n">rule_sets</span><span class="p" data-group-id="7399889620-1">(</span><span class="s">"en"</span><span class="p" data-group-id="7399889620-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="o">|></span><span class="w"> </span><span class="nc">Enum</span><span class="o">.</span><span class="n">sort</span><span class="p" data-group-id="7399889620-2">(</span><span class="p" data-group-id="7399889620-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7399889620-3">[</span><span class="w">
|
||||
</span><span class="ss">:spellout_cardinal</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:spellout_cardinal_verbose</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:spellout_numbering</span><span class="p">,</span><span class="w">
|
||||
@ -155,9 +155,9 @@ defined in the Unicode CLDR data repository. Available rules are identified by:
|
||||
</span><span class="ss">:spellout_numbering_year</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:spellout_ordinal</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">:spellout_ordinal_verbose</span><span class="w">
|
||||
</span><span class="p" data-group-id="4618678770-3">]</span></code></pre><p>A rule can then be invoked on an available rule_set. For example:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Spellout</span><span class="o">.</span><span class="n">spellout_ordinal</span><span class="p" data-group-id="5687608024-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="5687608024-1">)</span><span class="w">
|
||||
</span><span class="s">"one hundred twenty-third"</span></code></pre><p>This call is equivalent to the call through the public API of:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="6348142410-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:spellout</span><span class="p" data-group-id="6348142410-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6348142410-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"one hundred twenty-three"</span><span class="p" data-group-id="6348142410-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="7399889620-3">]</span></code></pre><p>A rule can then be invoked on an available rule_set. For example:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Rbnf.Spellout</span><span class="o">.</span><span class="n">spellout_ordinal</span><span class="p" data-group-id="7209912473-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="7209912473-1">)</span><span class="w">
|
||||
</span><span class="s">"one hundred twenty-third"</span></code></pre><p>This call is equivalent to the call through the public API of:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr.Number</span><span class="o">.</span><span class="n">to_string</span><span class="p" data-group-id="3174845174-1">(</span><span class="mi">123</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:spellout</span><span class="p" data-group-id="3174845174-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3174845174-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"one hundred twenty-three"</span><span class="p" data-group-id="3174845174-2">}</span></code></pre>
|
||||
</section>
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -558,24 +558,24 @@ current locale is restored after the function.</p></div>
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">default_locale</span><span class="p" data-group-id="4798971727-1">(</span><span class="p" data-group-id="4798971727-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4798971727-2">%</span><span class="nc" data-group-id="4798971727-2">Cldr.LanguageTag</span><span class="p" data-group-id="4798971727-2">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">default_locale</span><span class="p" data-group-id="7377114044-1">(</span><span class="p" data-group-id="7377114044-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7377114044-2">%</span><span class="nc" data-group-id="7377114044-2">Cldr.LanguageTag</span><span class="p" data-group-id="7377114044-2">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en-001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"en-001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4798971727-3">[</span><span class="p" data-group-id="4798971727-3">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4798971727-4">%{</span><span class="p" data-group-id="4798971727-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7377114044-3">[</span><span class="p" data-group-id="7377114044-3">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7377114044-4">%{</span><span class="p" data-group-id="7377114044-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4798971727-5">%{</span><span class="p" data-group-id="4798971727-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4798971727-6">[</span><span class="p" data-group-id="4798971727-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7377114044-5">%{</span><span class="p" data-group-id="7377114044-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7377114044-6">[</span><span class="p" data-group-id="7377114044-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en-001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:"001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4798971727-7">%{</span><span class="p" data-group-id="4798971727-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="4798971727-8">[</span><span class="p" data-group-id="4798971727-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="4798971727-2">}</span></code></pre>
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7377114044-7">%{</span><span class="p" data-group-id="7377114044-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="7377114044-8">[</span><span class="p" data-group-id="7377114044-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="7377114044-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="default_territory/0">
|
||||
@ -610,7 +610,7 @@ does not specify one and none can be inferred.</p><h2 id="default_territory/0-ex
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">default_territory</span><span class="p" data-group-id="7834796663-1">(</span><span class="p" data-group-id="7834796663-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">default_territory</span><span class="p" data-group-id="9896076478-1">(</span><span class="p" data-group-id="9896076478-1">)</span><span class="w">
|
||||
</span><span class="ss">:"001"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -670,16 +670,16 @@ is inserted between words or sentences. The valid options are
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="p" data-group-id="2197273768-1">(</span><span class="s">"And furthermore"</span><span class="p" data-group-id="2197273768-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="p" data-group-id="3837393308-1">(</span><span class="s">"And furthermore"</span><span class="p" data-group-id="3837393308-1">)</span><span class="w">
|
||||
</span><span class="s">"And furthermore…"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="p" data-group-id="2197273768-2">(</span><span class="p" data-group-id="2197273768-3">[</span><span class="s">"And furthermore"</span><span class="p">,</span><span class="w"> </span><span class="s">"there is much to be done"</span><span class="p" data-group-id="2197273768-3">]</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="ss">:ja</span><span class="p" data-group-id="2197273768-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="p" data-group-id="3837393308-2">(</span><span class="p" data-group-id="3837393308-3">[</span><span class="s">"And furthermore"</span><span class="p">,</span><span class="w"> </span><span class="s">"there is much to be done"</span><span class="p" data-group-id="3837393308-3">]</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="ss">:ja</span><span class="p" data-group-id="3837393308-2">)</span><span class="w">
|
||||
</span><span class="s">"And furthermore…there is much to be done"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="p" data-group-id="2197273768-4">(</span><span class="s">"And furthermore"</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:word</span><span class="p" data-group-id="2197273768-4">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="p" data-group-id="3837393308-4">(</span><span class="s">"And furthermore"</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:word</span><span class="p" data-group-id="3837393308-4">)</span><span class="w">
|
||||
</span><span class="s">"And furthermore …"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="p" data-group-id="2197273768-5">(</span><span class="p" data-group-id="2197273768-6">[</span><span class="s">"And furthermore"</span><span class="p">,</span><span class="w"> </span><span class="s">"there is much to be done"</span><span class="p" data-group-id="2197273768-6">]</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="ss">:ja</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:word</span><span class="p" data-group-id="2197273768-5">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">ellipsis</span><span class="p" data-group-id="3837393308-5">(</span><span class="p" data-group-id="3837393308-6">[</span><span class="s">"And furthermore"</span><span class="p">,</span><span class="w"> </span><span class="s">"there is much to be done"</span><span class="p" data-group-id="3837393308-6">]</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="ss">:ja</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="ss">:word</span><span class="p" data-group-id="3837393308-5">)</span><span class="w">
|
||||
</span><span class="s">"And furthermore … there is much to be done"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -715,23 +715,23 @@ take an optional locale parameter for which a locale is not supplied.</p><h2 id=
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_locale</span><span class="p" data-group-id="8215010345-1">(</span><span class="s">"pl"</span><span class="p" data-group-id="8215010345-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">get_locale</span><span class="p" data-group-id="8215010345-2">(</span><span class="p" data-group-id="8215010345-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8215010345-3">%</span><span class="nc" data-group-id="8215010345-3">Cldr.LanguageTag</span><span class="p" data-group-id="8215010345-3">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_locale</span><span class="p" data-group-id="8595078282-1">(</span><span class="s">"pl"</span><span class="p" data-group-id="8595078282-1">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">get_locale</span><span class="p" data-group-id="8595078282-2">(</span><span class="p" data-group-id="8595078282-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8595078282-3">%</span><span class="nc" data-group-id="8595078282-3">Cldr.LanguageTag</span><span class="p" data-group-id="8595078282-3">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">Elixir.Plausible.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"pl"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:pl</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8215010345-4">%{</span><span class="p" data-group-id="8215010345-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8595078282-4">%{</span><span class="p" data-group-id="8595078282-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"pl"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8215010345-5">%{</span><span class="p" data-group-id="8215010345-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8215010345-6">[</span><span class="p" data-group-id="8215010345-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8595078282-5">%{</span><span class="p" data-group-id="8595078282-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8595078282-6">[</span><span class="p" data-group-id="8595078282-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:pl</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:PL</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"pl"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8215010345-7">%{</span><span class="p" data-group-id="8215010345-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8215010345-8">[</span><span class="p" data-group-id="8215010345-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8215010345-3">}</span></code></pre>
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8595078282-7">%{</span><span class="p" data-group-id="8595078282-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8595078282-8">[</span><span class="p" data-group-id="8595078282-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="8595078282-3">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="known_calendars/0">
|
||||
@ -818,10 +818,10 @@ take an optional locale parameter for which a locale is not supplied.</p><h2 id=
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_gettext_locale_name</span><span class="p" data-group-id="3817069427-1">(</span><span class="s">"en"</span><span class="p" data-group-id="3817069427-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_gettext_locale_name</span><span class="p" data-group-id="9500649859-1">(</span><span class="s">"en"</span><span class="p" data-group-id="9500649859-1">)</span><span class="w">
|
||||
</span><span class="s">"en"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_gettext_locale_name</span><span class="p" data-group-id="3817069427-2">(</span><span class="s">"en-SA"</span><span class="p" data-group-id="3817069427-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_gettext_locale_name</span><span class="p" data-group-id="9500649859-2">(</span><span class="s">"en-SA"</span><span class="p" data-group-id="9500649859-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -864,10 +864,10 @@ name is configured and available in Gettext.</p><h2 id="known_gettext_locale_nam
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_gettext_locale_name?</span><span class="p" data-group-id="7978794737-1">(</span><span class="s">"en"</span><span class="p" data-group-id="7978794737-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_gettext_locale_name?</span><span class="p" data-group-id="3660845928-1">(</span><span class="s">"en"</span><span class="p" data-group-id="3660845928-1">)</span><span class="w">
|
||||
</span><span class="no">true</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_gettext_locale_name?</span><span class="p" data-group-id="7978794737-2">(</span><span class="s">"!!"</span><span class="p" data-group-id="7978794737-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_gettext_locale_name?</span><span class="p" data-group-id="3660845928-2">(</span><span class="s">"!!"</span><span class="p" data-group-id="3660845928-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -941,10 +941,10 @@ to return the first known locale name from a list.</p><h2 id="known_locale_name/
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_locale_name</span><span class="p" data-group-id="3658681071-1">(</span><span class="ss">:"en-AU"</span><span class="p" data-group-id="3658681071-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_locale_name</span><span class="p" data-group-id="3805588319-1">(</span><span class="ss">:"en-AU"</span><span class="p" data-group-id="3805588319-1">)</span><span class="w">
|
||||
</span><span class="ss">:"en-AU"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_locale_name</span><span class="p" data-group-id="3658681071-2">(</span><span class="ss">:"en-SA"</span><span class="p" data-group-id="3658681071-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_locale_name</span><span class="p" data-group-id="3805588319-2">(</span><span class="ss">:"en-SA"</span><span class="p" data-group-id="3805588319-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -986,10 +986,10 @@ name is configured and available in Cldr.</p><h2 id="known_locale_name?/1-argume
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_locale_name?</span><span class="p" data-group-id="2124384004-1">(</span><span class="ss">:en</span><span class="p" data-group-id="2124384004-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_locale_name?</span><span class="p" data-group-id="0186052189-1">(</span><span class="ss">:en</span><span class="p" data-group-id="0186052189-1">)</span><span class="w">
|
||||
</span><span class="no">true</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_locale_name?</span><span class="p" data-group-id="2124384004-2">(</span><span class="ss">:"!!"</span><span class="p" data-group-id="2124384004-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_locale_name?</span><span class="p" data-group-id="0186052189-2">(</span><span class="ss">:"!!"</span><span class="p" data-group-id="0186052189-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1043,8 +1043,8 @@ in this module or in <a href="https://hexdocs.pm/gettext/0.24.0/Gettext.html"><c
|
||||
</a>
|
||||
<span class="text">Example</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_number_system_types</span><span class="p" data-group-id="3401453996-1">(</span><span class="p" data-group-id="3401453996-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3401453996-2">[</span><span class="ss">:default</span><span class="p">,</span><span class="w"> </span><span class="ss">:finance</span><span class="p">,</span><span class="w"> </span><span class="ss">:native</span><span class="p">,</span><span class="w"> </span><span class="ss">:traditional</span><span class="p" data-group-id="3401453996-2">]</span></code></pre>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_number_system_types</span><span class="p" data-group-id="3222276703-1">(</span><span class="p" data-group-id="3222276703-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="3222276703-2">[</span><span class="ss">:default</span><span class="p">,</span><span class="w"> </span><span class="ss">:finance</span><span class="p">,</span><span class="w"> </span><span class="ss">:native</span><span class="p">,</span><span class="w"> </span><span class="ss">:traditional</span><span class="p" data-group-id="3222276703-2">]</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="known_number_systems/0">
|
||||
@ -1109,10 +1109,10 @@ and has RBNF rules defined.</p><h2 id="known_rbnf_locale_name/1-arguments" class
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_rbnf_locale_name</span><span class="p" data-group-id="9302737728-1">(</span><span class="ss">:en</span><span class="p" data-group-id="9302737728-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_rbnf_locale_name</span><span class="p" data-group-id="9578937654-1">(</span><span class="ss">:en</span><span class="p" data-group-id="9578937654-1">)</span><span class="w">
|
||||
</span><span class="ss">:en</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_rbnf_locale_name</span><span class="p" data-group-id="9302737728-2">(</span><span class="ss">:"en-SA"</span><span class="p" data-group-id="9302737728-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_rbnf_locale_name</span><span class="p" data-group-id="9578937654-2">(</span><span class="ss">:"en-SA"</span><span class="p" data-group-id="9578937654-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1155,10 +1155,10 @@ rules based number formats (RBNF).</p><h2 id="known_rbnf_locale_name?/1-argument
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_rbnf_locale_name?</span><span class="p" data-group-id="6281016835-1">(</span><span class="ss">:en</span><span class="p" data-group-id="6281016835-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_rbnf_locale_name?</span><span class="p" data-group-id="8725702308-1">(</span><span class="ss">:en</span><span class="p" data-group-id="8725702308-1">)</span><span class="w">
|
||||
</span><span class="no">true</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_rbnf_locale_name?</span><span class="p" data-group-id="6281016835-2">(</span><span class="ss">:"!!"</span><span class="p" data-group-id="6281016835-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">known_rbnf_locale_name?</span><span class="p" data-group-id="8725702308-2">(</span><span class="ss">:"!!"</span><span class="p" data-group-id="8725702308-2">)</span><span class="w">
|
||||
</span><span class="no">false</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1294,14 +1294,14 @@ CLDR backend defined by the <code class="inline">t:Cldr.LanguageTag</code> is se
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="kn">import</span><span class="w"> </span><span class="nc">Cldr.LanguageTag.Sigil</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_gettext_locale</span><span class="p" data-group-id="8727061651-1">(</span><span class="sx">~l"en"</span><span class="p" data-group-id="8727061651-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8727061651-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="8727061651-2">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_gettext_locale</span><span class="p" data-group-id="4532140980-1">(</span><span class="sx">~l"en"</span><span class="p" data-group-id="4532140980-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4532140980-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="s">"en"</span><span class="p" data-group-id="4532140980-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="kn">import</span><span class="w"> </span><span class="nc">Cldr.LanguageTag.Sigil</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_gettext_locale</span><span class="p" data-group-id="8727061651-3">(</span><span class="sx">~l"de"</span><span class="p" data-group-id="8727061651-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8727061651-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="8727061651-5">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Locale #Cldr.LanguageTag<de [validated]> does not map to a known gettext locale name"</span><span class="p" data-group-id="8727061651-5">}</span><span class="p" data-group-id="8727061651-4">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_gettext_locale</span><span class="p" data-group-id="4532140980-3">(</span><span class="sx">~l"de"</span><span class="p" data-group-id="4532140980-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4532140980-4">{</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="4532140980-5">{</span><span class="nc">Cldr.UnknownLocaleError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Locale #Cldr.LanguageTag<de [validated]> does not map to a known gettext locale name"</span><span class="p" data-group-id="4532140980-5">}</span><span class="p" data-group-id="4532140980-4">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="put_locale/1">
|
||||
@ -1345,29 +1345,29 @@ of a language tag.</p><h2 id="put_locale/1-examples" class="section-heading">
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_locale</span><span class="p" data-group-id="2982856849-1">(</span><span class="s">"en"</span><span class="p" data-group-id="2982856849-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2982856849-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="2982856849-3">%</span><span class="nc" data-group-id="2982856849-3">Cldr.LanguageTag</span><span class="p" data-group-id="2982856849-3">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_locale</span><span class="p" data-group-id="6377431542-1">(</span><span class="s">"en"</span><span class="p" data-group-id="6377431542-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6377431542-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6377431542-3">%</span><span class="nc" data-group-id="6377431542-3">Cldr.LanguageTag</span><span class="p" data-group-id="6377431542-3">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2982856849-4">[</span><span class="p" data-group-id="2982856849-4">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2982856849-5">%{</span><span class="p" data-group-id="2982856849-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_subtags</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6377431542-4">[</span><span class="p" data-group-id="6377431542-4">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6377431542-5">%{</span><span class="p" data-group-id="6377431542-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2982856849-6">%{</span><span class="p" data-group-id="2982856849-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2982856849-7">[</span><span class="p" data-group-id="2982856849-7">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6377431542-6">%{</span><span class="p" data-group-id="6377431542-6">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6377431542-7">[</span><span class="p" data-group-id="6377431542-7">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:US</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2982856849-8">%{</span><span class="p" data-group-id="2982856849-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2982856849-9">[</span><span class="p" data-group-id="2982856849-9">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="2982856849-3">}</span><span class="p" data-group-id="2982856849-2">}</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6377431542-8">%{</span><span class="p" data-group-id="6377431542-8">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6377431542-9">[</span><span class="p" data-group-id="6377431542-9">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="6377431542-3">}</span><span class="p" data-group-id="6377431542-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_locale</span><span class="p" data-group-id="2982856849-10">(</span><span class="s">"invalid-locale!"</span><span class="p" data-group-id="2982856849-10">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="2982856849-11">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2982856849-12">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">!</span><span class="se">\"</span><span class="s"> starting at position 15"</span><span class="p" data-group-id="2982856849-12">}</span><span class="p" data-group-id="2982856849-11">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">put_locale</span><span class="p" data-group-id="6377431542-10">(</span><span class="s">"invalid-locale!"</span><span class="p" data-group-id="6377431542-10">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6377431542-11">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6377431542-12">{</span><span class="nc">Cldr.LanguageTag.ParseError</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"Expected a BCP47 language tag. Could not parse the remaining </span><span class="se">\"</span><span class="s">!</span><span class="se">\"</span><span class="s"> starting at position 15"</span><span class="p" data-group-id="6377431542-12">}</span><span class="p" data-group-id="6377431542-11">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="quote/2">
|
||||
@ -1416,10 +1416,10 @@ The default is <a href="https://hexdocs.pm/ex_cldr/2.37.5/Cldr.html#get_locale/0
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="k">quote</span><span class="p" data-group-id="4737922595-1">(</span><span class="s">"Quoted String"</span><span class="p" data-group-id="4737922595-1">)</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="k">quote</span><span class="p" data-group-id="2980893929-1">(</span><span class="s">"Quoted String"</span><span class="p" data-group-id="2980893929-1">)</span><span class="w">
|
||||
</span><span class="s">"“Quoted String”"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="k">quote</span><span class="p" data-group-id="4737922595-2">(</span><span class="s">"Quoted String"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="ss">:ja</span><span class="p" data-group-id="4737922595-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="k">quote</span><span class="p" data-group-id="2980893929-2">(</span><span class="s">"Quoted String"</span><span class="p">,</span><span class="w"> </span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="ss">:ja</span><span class="p" data-group-id="2980893929-2">)</span><span class="w">
|
||||
</span><span class="s">"「Quoted String」"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -1550,47 +1550,47 @@ of a language tag.</p><h2 id="validate_locale/1-examples" class="section-heading
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="6976952090-1">(</span><span class="ss">:en</span><span class="p" data-group-id="6976952090-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6976952090-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6976952090-3">%</span><span class="nc" data-group-id="6976952090-3">Cldr.LanguageTag</span><span class="p" data-group-id="6976952090-3">{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="0651851437-1">(</span><span class="ss">:en</span><span class="p" data-group-id="0651851437-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0651851437-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0651851437-3">%</span><span class="nc" data-group-id="0651851437-3">Cldr.LanguageTag</span><span class="p" data-group-id="0651851437-3">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6976952090-4">%{</span><span class="p" data-group-id="6976952090-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0651851437-4">%{</span><span class="p" data-group-id="0651851437-4">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6976952090-5">%{</span><span class="p" data-group-id="6976952090-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6976952090-6">[</span><span class="p" data-group-id="6976952090-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0651851437-5">%{</span><span class="p" data-group-id="0651851437-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0651851437-6">[</span><span class="p" data-group-id="0651851437-6">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:US</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6976952090-7">%{</span><span class="p" data-group-id="6976952090-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6976952090-8">[</span><span class="p" data-group-id="6976952090-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="6976952090-3">}</span><span class="p" data-group-id="6976952090-2">}</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0651851437-7">%{</span><span class="p" data-group-id="0651851437-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0651851437-8">[</span><span class="p" data-group-id="0651851437-8">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="0651851437-3">}</span><span class="p" data-group-id="0651851437-2">}</span><span class="w">
|
||||
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">default_locale</span><span class="p" data-group-id="6976952090-9">(</span><span class="p" data-group-id="6976952090-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6976952090-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="6976952090-11">%</span><span class="nc" data-group-id="6976952090-11">Cldr.LanguageTag</span><span class="p" data-group-id="6976952090-11">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">default_locale</span><span class="p" data-group-id="0651851437-9">(</span><span class="p" data-group-id="0651851437-9">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0651851437-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="0651851437-11">%</span><span class="nc" data-group-id="0651851437-11">Cldr.LanguageTag</span><span class="p" data-group-id="0651851437-11">{</span><span class="w">
|
||||
</span><span class="ss">backend</span><span class="p">:</span><span class="w"> </span><span class="nc">Plausible.Cldr</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">canonical_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en-001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">cldr_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:"en-001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6976952090-12">%{</span><span class="p" data-group-id="6976952090-12">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">extensions</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0651851437-12">%{</span><span class="p" data-group-id="0651851437-12">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">gettext_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language</span><span class="p">:</span><span class="w"> </span><span class="s">"en"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6976952090-13">%{</span><span class="p" data-group-id="6976952090-13">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6976952090-14">[</span><span class="p" data-group-id="6976952090-14">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">locale</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0651851437-13">%{</span><span class="p" data-group-id="0651851437-13">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">private_use</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0651851437-14">[</span><span class="p" data-group-id="0651851437-14">]</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">rbnf_locale_name</span><span class="p">:</span><span class="w"> </span><span class="ss">:en</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">requested_locale_name</span><span class="p">:</span><span class="w"> </span><span class="s">"en-001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">script</span><span class="p">:</span><span class="w"> </span><span class="ss">:Latn</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">territory</span><span class="p">:</span><span class="w"> </span><span class="ss">:"001"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6976952090-15">%{</span><span class="p" data-group-id="6976952090-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6976952090-16">[</span><span class="p" data-group-id="6976952090-16">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="6976952090-11">}</span><span class="p" data-group-id="6976952090-10">}</span><span class="w">
|
||||
</span><span class="ss">transform</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0651851437-15">%{</span><span class="p" data-group-id="0651851437-15">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="ss">language_variants</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0651851437-16">[</span><span class="p" data-group-id="0651851437-16">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="0651851437-11">}</span><span class="p" data-group-id="0651851437-10">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="6976952090-17">(</span><span class="s">"zzz"</span><span class="p" data-group-id="6976952090-17">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6976952090-18">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="6976952090-19">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zzz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="6976952090-19">}</span><span class="p" data-group-id="6976952090-18">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_locale</span><span class="p" data-group-id="0651851437-17">(</span><span class="s">"zzz"</span><span class="p" data-group-id="0651851437-17">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0651851437-18">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="0651851437-19">{</span><span class="nc">Cldr.InvalidLanguageError</span><span class="p">,</span><span class="w"> </span><span class="s">"The language </span><span class="se">\"</span><span class="s">zzz</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="0651851437-19">}</span><span class="p" data-group-id="0651851437-18">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="validate_number_system/1">
|
||||
@ -1660,23 +1660,23 @@ of a language tag.</p><h2 id="validate_locale/1-examples" class="section-heading
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_number_system_type</span><span class="p" data-group-id="7555491607-1">(</span><span class="ss">:default</span><span class="p" data-group-id="7555491607-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7555491607-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="p" data-group-id="7555491607-2">}</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_number_system_type</span><span class="p" data-group-id="0354974725-1">(</span><span class="ss">:default</span><span class="p" data-group-id="0354974725-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0354974725-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:default</span><span class="p" data-group-id="0354974725-2">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_number_system_type</span><span class="p" data-group-id="7555491607-3">(</span><span class="ss">:traditional</span><span class="p" data-group-id="7555491607-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7555491607-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:traditional</span><span class="p" data-group-id="7555491607-4">}</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_number_system_type</span><span class="p" data-group-id="0354974725-3">(</span><span class="ss">:traditional</span><span class="p" data-group-id="0354974725-3">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0354974725-4">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="ss">:traditional</span><span class="p" data-group-id="0354974725-4">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_number_system_type</span><span class="p" data-group-id="7555491607-5">(</span><span class="ss">:latn</span><span class="p" data-group-id="7555491607-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7555491607-6">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_number_system_type</span><span class="p" data-group-id="0354974725-5">(</span><span class="ss">:latn</span><span class="p" data-group-id="0354974725-5">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0354974725-6">{</span><span class="w">
|
||||
</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7555491607-7">{</span><span class="nc">Cldr.UnknownNumberSystemTypeError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system type :latn is unknown"</span><span class="p" data-group-id="7555491607-7">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="7555491607-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0354974725-7">{</span><span class="nc">Cldr.UnknownNumberSystemTypeError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system type :latn is unknown"</span><span class="p" data-group-id="0354974725-7">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0354974725-6">}</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_number_system_type</span><span class="p" data-group-id="7555491607-8">(</span><span class="s">"bork"</span><span class="p" data-group-id="7555491607-8">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="7555491607-9">{</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="nc">Plausible.Cldr</span><span class="o">.</span><span class="n">validate_number_system_type</span><span class="p" data-group-id="0354974725-8">(</span><span class="s">"bork"</span><span class="p" data-group-id="0354974725-8">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0354974725-9">{</span><span class="w">
|
||||
</span><span class="ss">:error</span><span class="p">,</span><span class="w">
|
||||
</span><span class="p" data-group-id="7555491607-10">{</span><span class="nc">Cldr.UnknownNumberSystemTypeError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system type </span><span class="se">\"</span><span class="s">bork</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="7555491607-10">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="7555491607-9">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="0354974725-10">{</span><span class="nc">Cldr.UnknownNumberSystemTypeError</span><span class="p">,</span><span class="w"> </span><span class="s">"The number system type </span><span class="se">\"</span><span class="s">bork</span><span class="se">\"</span><span class="s"> is invalid"</span><span class="p" data-group-id="0354974725-10">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="0354974725-9">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="validate_territory/1">
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -845,23 +845,23 @@ pool to disconnect within the given interval.</p><p>See <a href="https://hexdocs
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<p>Similar to <code class="inline">insert_all/2</code> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="8406479898-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="8406479898-1">)</span><span class="w">
|
||||
<p>Similar to <code class="inline">insert_all/2</code> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="9578251065-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="9578251065-1">)</span><span class="w">
|
||||
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="8406479898-2">do</span><span class="w">
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="9578251065-2">do</span><span class="w">
|
||||
</span><span class="kn">use</span><span class="w"> </span><span class="nc">Ecto.Schema</span><span class="w">
|
||||
|
||||
</span><span class="na">@primary_key</span><span class="w"> </span><span class="no">false</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="8406479898-3">do</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="9578251065-3">do</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:a</span><span class="p">,</span><span class="w"> </span><span class="nc">Ch</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="s">"UInt64"</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:b</span><span class="p">,</span><span class="w"> </span><span class="ss">:string</span><span class="w">
|
||||
</span><span class="k" data-group-id="8406479898-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="8406479898-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="9578251065-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="9578251065-2">end</span><span class="w">
|
||||
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="8406479898-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="8406479898-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="8406479898-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="8406479898-7">(</span><span class="n">i</span><span class="p" data-group-id="8406479898-7">)</span><span class="p" data-group-id="8406479898-6">}</span><span class="w"> </span><span class="k" data-group-id="8406479898-5">end</span><span class="p" data-group-id="8406479898-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8406479898-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="8406479898-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="8406479898-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="8406479898-9">)</span><span class="w">
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="9578251065-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="9578251065-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="9578251065-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="9578251065-7">(</span><span class="n">i</span><span class="p" data-group-id="9578251065-7">)</span><span class="p" data-group-id="9578251065-6">}</span><span class="w"> </span><span class="k" data-group-id="9578251065-5">end</span><span class="p" data-group-id="9578251065-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9578251065-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="9578251065-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="9578251065-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="9578251065-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="8406479898-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="8406479898-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="8406479898-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8406479898-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="8406479898-13">(</span><span class="p" data-group-id="8406479898-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="8406479898-12">]</span><span class="p" data-group-id="8406479898-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="9578251065-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="9578251065-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="9578251065-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9578251065-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="9578251065-13">(</span><span class="p" data-group-id="9578251065-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="9578251065-12">]</span><span class="p" data-group-id="9578251065-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -1152,23 +1152,23 @@ pool to disconnect within the given interval.</p><p>See <a href="https://hexdocs
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="9540497868-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="9540497868-1">)</span><span class="w">
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="0168486379-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="0168486379-1">)</span><span class="w">
|
||||
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="9540497868-2">do</span><span class="w">
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="0168486379-2">do</span><span class="w">
|
||||
</span><span class="kn">use</span><span class="w"> </span><span class="nc">Ecto.Schema</span><span class="w">
|
||||
|
||||
</span><span class="na">@primary_key</span><span class="w"> </span><span class="no">false</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="9540497868-3">do</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="0168486379-3">do</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:a</span><span class="p">,</span><span class="w"> </span><span class="nc">Ch</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="s">"UInt64"</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:b</span><span class="p">,</span><span class="w"> </span><span class="ss">:string</span><span class="w">
|
||||
</span><span class="k" data-group-id="9540497868-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="9540497868-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="0168486379-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="0168486379-2">end</span><span class="w">
|
||||
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="9540497868-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="9540497868-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="9540497868-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="9540497868-7">(</span><span class="n">i</span><span class="p" data-group-id="9540497868-7">)</span><span class="p" data-group-id="9540497868-6">}</span><span class="w"> </span><span class="k" data-group-id="9540497868-5">end</span><span class="p" data-group-id="9540497868-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9540497868-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="9540497868-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="9540497868-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="9540497868-9">)</span><span class="w">
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="0168486379-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="0168486379-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="0168486379-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="0168486379-7">(</span><span class="n">i</span><span class="p" data-group-id="0168486379-7">)</span><span class="p" data-group-id="0168486379-6">}</span><span class="w"> </span><span class="k" data-group-id="0168486379-5">end</span><span class="p" data-group-id="0168486379-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="0168486379-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="0168486379-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="0168486379-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="0168486379-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="9540497868-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="9540497868-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="9540497868-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="9540497868-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="9540497868-13">(</span><span class="p" data-group-id="9540497868-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="9540497868-12">]</span><span class="p" data-group-id="9540497868-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="0168486379-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="0168486379-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="0168486379-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="0168486379-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="0168486379-13">(</span><span class="p" data-group-id="0168486379-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="0168486379-12">]</span><span class="p" data-group-id="0168486379-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -294,10 +294,10 @@ tables into the format of <code class="inline">imported_*</code> tables for a w
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<p>Renders filename for the Zip archive containing the exported CSV files.</p><p>Examples:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">archive_filename</span><span class="p" data-group-id="6809650693-1">(</span><span class="s">"plausible.io"</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[2021-01-01]</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[2024-12-31]</span><span class="p" data-group-id="6809650693-1">)</span><span class="w">
|
||||
<p>Renders filename for the Zip archive containing the exported CSV files.</p><p>Examples:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">archive_filename</span><span class="p" data-group-id="7824820903-1">(</span><span class="s">"plausible.io"</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[2021-01-01]</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[2024-12-31]</span><span class="p" data-group-id="7824820903-1">)</span><span class="w">
|
||||
</span><span class="s">"plausible_io_20210101_20241231.zip"</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="n">archive_filename</span><span class="p" data-group-id="6809650693-2">(</span><span class="s">"Bücher.example"</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[2021-01-01]</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[2024-12-31]</span><span class="p" data-group-id="6809650693-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="n">archive_filename</span><span class="p" data-group-id="7824820903-2">(</span><span class="s">"Bücher.example"</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[2021-01-01]</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[2024-12-31]</span><span class="p" data-group-id="7824820903-2">)</span><span class="w">
|
||||
</span><span class="s">"Bücher_example_20210101_20241231.zip"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -617,14 +617,14 @@ tables into the format of <code class="inline">imported_*</code> tables for a w
|
||||
|
||||
</div>
|
||||
|
||||
<p>Creates a streamable Zip archive from the provided (named) Ecto queries.</p><p>Example usage:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="3075716523-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">pool</span><span class="p" data-group-id="3075716523-1">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Ch</span><span class="o">.</span><span class="n">start_link</span><span class="p" data-group-id="3075716523-2">(</span><span class="ss">pool_size</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p" data-group-id="3075716523-2">)</span><span class="w">
|
||||
<p>Creates a streamable Zip archive from the provided (named) Ecto queries.</p><p>Example usage:</p><pre><code class="makeup elixir" translate="no"><span class="p" data-group-id="5272561910-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">pool</span><span class="p" data-group-id="5272561910-1">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Ch</span><span class="o">.</span><span class="n">start_link</span><span class="p" data-group-id="5272561910-2">(</span><span class="ss">pool_size</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p" data-group-id="5272561910-2">)</span><span class="w">
|
||||
|
||||
</span><span class="nc">DBConnection</span><span class="o">.</span><span class="n">run</span><span class="p" data-group-id="3075716523-3">(</span><span class="n">pool</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="3075716523-4">fn</span><span class="w"> </span><span class="n">conn</span><span class="w"> </span><span class="o">-></span><span class="w">
|
||||
</span><span class="nc">DBConnection</span><span class="o">.</span><span class="n">run</span><span class="p" data-group-id="5272561910-3">(</span><span class="n">pool</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="5272561910-4">fn</span><span class="w"> </span><span class="n">conn</span><span class="w"> </span><span class="o">-></span><span class="w">
|
||||
</span><span class="n">conn</span><span class="w">
|
||||
</span><span class="o">|></span><span class="w"> </span><span class="n">stream_archive</span><span class="p" data-group-id="3075716523-5">(</span><span class="n">export_queries</span><span class="p" data-group-id="3075716523-6">(</span><span class="c">_site_id</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p" data-group-id="3075716523-6">)</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="s">"CSVWithNames"</span><span class="p" data-group-id="3075716523-5">)</span><span class="w">
|
||||
</span><span class="o">|></span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">into</span><span class="p" data-group-id="3075716523-7">(</span><span class="nc">File</span><span class="o">.</span><span class="n">stream!</span><span class="p" data-group-id="3075716523-8">(</span><span class="s">"export.zip"</span><span class="p" data-group-id="3075716523-8">)</span><span class="p" data-group-id="3075716523-7">)</span><span class="w">
|
||||
</span><span class="o">|></span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">run</span><span class="p" data-group-id="3075716523-9">(</span><span class="p" data-group-id="3075716523-9">)</span><span class="w">
|
||||
</span><span class="k" data-group-id="3075716523-4">end</span><span class="p" data-group-id="3075716523-3">)</span></code></pre>
|
||||
</span><span class="o">|></span><span class="w"> </span><span class="n">stream_archive</span><span class="p" data-group-id="5272561910-5">(</span><span class="n">export_queries</span><span class="p" data-group-id="5272561910-6">(</span><span class="c">_site_id</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p" data-group-id="5272561910-6">)</span><span class="p">,</span><span class="w"> </span><span class="ss">format</span><span class="p">:</span><span class="w"> </span><span class="s">"CSVWithNames"</span><span class="p" data-group-id="5272561910-5">)</span><span class="w">
|
||||
</span><span class="o">|></span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">into</span><span class="p" data-group-id="5272561910-7">(</span><span class="nc">File</span><span class="o">.</span><span class="n">stream!</span><span class="p" data-group-id="5272561910-8">(</span><span class="s">"export.zip"</span><span class="p" data-group-id="5272561910-8">)</span><span class="p" data-group-id="5272561910-7">)</span><span class="w">
|
||||
</span><span class="o">|></span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">run</span><span class="p" data-group-id="5272561910-9">(</span><span class="p" data-group-id="5272561910-9">)</span><span class="w">
|
||||
</span><span class="k" data-group-id="5272561910-4">end</span><span class="p" data-group-id="5272561910-3">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -260,8 +260,8 @@ and MaxMind license key.</p></div>
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<p> In the case of a DB-IP database:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">database_type</span><span class="p" data-group-id="6909702164-1">(</span><span class="p" data-group-id="6909702164-1">)</span><span class="w">
|
||||
</span><span class="s">"DBIP-City-Lite"</span></code></pre><p> In the case of a MaxMind database:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">database_type</span><span class="p" data-group-id="1178919074-1">(</span><span class="p" data-group-id="1178919074-1">)</span><span class="w">
|
||||
<p> In the case of a DB-IP database:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">database_type</span><span class="p" data-group-id="9011569537-1">(</span><span class="p" data-group-id="9011569537-1">)</span><span class="w">
|
||||
</span><span class="s">"DBIP-City-Lite"</span></code></pre><p> In the case of a MaxMind database:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">database_type</span><span class="p" data-group-id="6307120432-1">(</span><span class="p" data-group-id="6307120432-1">)</span><span class="w">
|
||||
</span><span class="s">"GeoLite2-City"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -302,8 +302,8 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<p> Loading from a local file:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">load_db</span><span class="p" data-group-id="5504727052-1">(</span><span class="ss">path</span><span class="p">:</span><span class="w"> </span><span class="s">"/etc/plausible/dbip-city.mmdb"</span><span class="p" data-group-id="5504727052-1">)</span><span class="w">
|
||||
</span><span class="ss">:ok</span></code></pre><p> Downloading a MaxMind DB (this license key is no longer active):</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">load_db</span><span class="p" data-group-id="1695848779-1">(</span><span class="ss">license_key</span><span class="p">:</span><span class="w"> </span><span class="s">"LNpsJCCKPis6XvBP"</span><span class="p">,</span><span class="w"> </span><span class="ss">edition</span><span class="p">:</span><span class="w"> </span><span class="s">"GeoLite2-City"</span><span class="p">,</span><span class="w"> </span><span class="ss">async</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="p" data-group-id="1695848779-1">)</span><span class="w">
|
||||
<p> Loading from a local file:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">load_db</span><span class="p" data-group-id="9097834356-1">(</span><span class="ss">path</span><span class="p">:</span><span class="w"> </span><span class="s">"/etc/plausible/dbip-city.mmdb"</span><span class="p" data-group-id="9097834356-1">)</span><span class="w">
|
||||
</span><span class="ss">:ok</span></code></pre><p> Downloading a MaxMind DB (this license key is no longer active):</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">load_db</span><span class="p" data-group-id="3154095867-1">(</span><span class="ss">license_key</span><span class="p">:</span><span class="w"> </span><span class="s">"LNpsJCCKPis6XvBP"</span><span class="p">,</span><span class="w"> </span><span class="ss">edition</span><span class="p">:</span><span class="w"> </span><span class="s">"GeoLite2-City"</span><span class="p">,</span><span class="w"> </span><span class="ss">async</span><span class="p">:</span><span class="w"> </span><span class="no">true</span><span class="p" data-group-id="3154095867-1">)</span><span class="w">
|
||||
</span><span class="ss">:ok</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -332,21 +332,21 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
</a>
|
||||
<span class="text">Examples</span>
|
||||
</h2>
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">lookup</span><span class="p" data-group-id="4843558849-1">(</span><span class="s">"8.7.6.5"</span><span class="p" data-group-id="4843558849-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-2">%{</span><span class="w">
|
||||
</span><span class="s">"city"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4843558849-3">%{</span><span class="w">
|
||||
<pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">lookup</span><span class="p" data-group-id="9014025839-1">(</span><span class="s">"8.7.6.5"</span><span class="p" data-group-id="9014025839-1">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-2">%{</span><span class="w">
|
||||
</span><span class="s">"city"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9014025839-3">%{</span><span class="w">
|
||||
</span><span class="s">"geoname_id"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">5349755</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4843558849-4">%{</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9014025839-4">%{</span><span class="w">
|
||||
</span><span class="s">"de"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Fontana"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"en"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Fontana"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"ja"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"フォンタナ"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"ru"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Фонтана"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-4">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"continent"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4843558849-5">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-4">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"continent"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9014025839-5">%{</span><span class="w">
|
||||
</span><span class="s">"code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"NA"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"geoname_id"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">6255149</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4843558849-6">%{</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9014025839-6">%{</span><span class="w">
|
||||
</span><span class="s">"de"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Nordamerika"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"en"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"North America"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"es"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Norteamérica"</span><span class="p">,</span><span class="w">
|
||||
@ -355,12 +355,12 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
</span><span class="s">"pt-BR"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"América do Norte"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"ru"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Северная Америка"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"zh-CN"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"北美洲"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"country"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4843558849-7">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-6">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-5">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"country"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9014025839-7">%{</span><span class="w">
|
||||
</span><span class="s">"geoname_id"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">6252001</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"iso_code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"US"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4843558849-8">%{</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9014025839-8">%{</span><span class="w">
|
||||
</span><span class="s">"de"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Vereinigte Staaten"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"en"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"United States"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"es"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Estados Unidos"</span><span class="p">,</span><span class="w">
|
||||
@ -369,20 +369,20 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
</span><span class="s">"pt-BR"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"EUA"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"ru"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"США"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"zh-CN"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"美国"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-8">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"location"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4843558849-9">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-8">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-7">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"location"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9014025839-9">%{</span><span class="w">
|
||||
</span><span class="s">"accuracy_radius"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">50</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"latitude"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mf">34.1211</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"longitude"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="o">-</span><span class="mf">117.4362</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"metro_code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">803</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"time_zone"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"America/Los_Angeles"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-9">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"postal"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4843558849-10">%{</span><span class="s">"code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"92336"</span><span class="p" data-group-id="4843558849-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"registered_country"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4843558849-11">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-9">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"postal"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9014025839-10">%{</span><span class="s">"code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"92336"</span><span class="p" data-group-id="9014025839-10">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"registered_country"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9014025839-11">%{</span><span class="w">
|
||||
</span><span class="s">"geoname_id"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">6252001</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"iso_code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"US"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4843558849-12">%{</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9014025839-12">%{</span><span class="w">
|
||||
</span><span class="s">"de"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Vereinigte Staaten"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"en"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"United States"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"es"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Estados Unidos"</span><span class="p">,</span><span class="w">
|
||||
@ -391,13 +391,13 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
</span><span class="s">"pt-BR"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"EUA"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"ru"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"США"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"zh-CN"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"美国"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-11">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"subdivisions"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4843558849-13">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-14">%{</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-12">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-11">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"subdivisions"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9014025839-13">[</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-14">%{</span><span class="w">
|
||||
</span><span class="s">"geoname_id"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="mi">5332921</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"iso_code"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"CA"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="4843558849-15">%{</span><span class="w">
|
||||
</span><span class="s">"names"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="p" data-group-id="9014025839-15">%{</span><span class="w">
|
||||
</span><span class="s">"de"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Kalifornien"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"en"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"California"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"es"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"California"</span><span class="p">,</span><span class="w">
|
||||
@ -406,10 +406,10 @@ asynchronously.</p></li></ul><h2 id="load_db/1-examples" class="section-heading"
|
||||
</span><span class="s">"pt-BR"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Califórnia"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"ru"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"Калифорния"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="s">"zh-CN"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"加州"</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-15">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-14">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-13">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="4843558849-2">}</span></code></pre>
|
||||
</span><span class="p" data-group-id="9014025839-15">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-14">}</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-13">]</span><span class="w">
|
||||
</span><span class="p" data-group-id="9014025839-2">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -1143,23 +1143,23 @@ pool to disconnect within the given interval.</p><p>See <a href="https://hexdocs
|
||||
|
||||
<section class="docstring">
|
||||
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="6808958115-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="6808958115-1">)</span><span class="w">
|
||||
<p>Similar to <a href="#insert_all/2"><code class="inline">insert_all/2</code></a> but with the following differences:</p><ul><li>accepts rows as streams or lists</li><li>sends rows as a chunked request</li><li>doesn't autogenerate ids or does any other preprocessing</li></ul><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="nc">Repo</span><span class="o">.</span><span class="n">query!</span><span class="p" data-group-id="5373225215-1">(</span><span class="s">"create table ecto_ch_demo(a UInt64, b String) engine Null"</span><span class="p" data-group-id="5373225215-1">)</span><span class="w">
|
||||
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="6808958115-2">do</span><span class="w">
|
||||
</span><span class="kd">defmodule</span><span class="w"> </span><span class="nc">Demo</span><span class="w"> </span><span class="k" data-group-id="5373225215-2">do</span><span class="w">
|
||||
</span><span class="kn">use</span><span class="w"> </span><span class="nc">Ecto.Schema</span><span class="w">
|
||||
|
||||
</span><span class="na">@primary_key</span><span class="w"> </span><span class="no">false</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="6808958115-3">do</span><span class="w">
|
||||
</span><span class="n">schema</span><span class="w"> </span><span class="s">"ecto_ch_demo"</span><span class="w"> </span><span class="k" data-group-id="5373225215-3">do</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:a</span><span class="p">,</span><span class="w"> </span><span class="nc">Ch</span><span class="p">,</span><span class="w"> </span><span class="ss">type</span><span class="p">:</span><span class="w"> </span><span class="s">"UInt64"</span><span class="w">
|
||||
</span><span class="n">field</span><span class="w"> </span><span class="ss">:b</span><span class="p">,</span><span class="w"> </span><span class="ss">:string</span><span class="w">
|
||||
</span><span class="k" data-group-id="6808958115-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="6808958115-2">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="5373225215-3">end</span><span class="w">
|
||||
</span><span class="k" data-group-id="5373225215-2">end</span><span class="w">
|
||||
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="6808958115-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="6808958115-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="6808958115-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="6808958115-7">(</span><span class="n">i</span><span class="p" data-group-id="6808958115-7">)</span><span class="p" data-group-id="6808958115-6">}</span><span class="w"> </span><span class="k" data-group-id="6808958115-5">end</span><span class="p" data-group-id="6808958115-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="6808958115-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="6808958115-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="6808958115-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="6808958115-9">)</span><span class="w">
|
||||
</span><span class="n">rows</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Stream</span><span class="o">.</span><span class="n">map</span><span class="p" data-group-id="5373225215-4">(</span><span class="mi">1</span><span class="o">..</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="k" data-group-id="5373225215-5">fn</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">-></span><span class="w"> </span><span class="p" data-group-id="5373225215-6">%{</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="n">i</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="n">to_string</span><span class="p" data-group-id="5373225215-7">(</span><span class="n">i</span><span class="p" data-group-id="5373225215-7">)</span><span class="p" data-group-id="5373225215-6">}</span><span class="w"> </span><span class="k" data-group-id="5373225215-5">end</span><span class="p" data-group-id="5373225215-4">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="5373225215-8">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="5373225215-8">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="5373225215-9">(</span><span class="nc">Demo</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p" data-group-id="5373225215-9">)</span><span class="w">
|
||||
|
||||
</span><span class="c1"># schemaless</span><span class="w">
|
||||
</span><span class="p" data-group-id="6808958115-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="6808958115-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="6808958115-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="6808958115-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="6808958115-13">(</span><span class="p" data-group-id="6808958115-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="6808958115-12">]</span><span class="p" data-group-id="6808958115-11">)</span></code></pre>
|
||||
</span><span class="p" data-group-id="5373225215-10">{</span><span class="mi">100_000</span><span class="p">,</span><span class="w"> </span><span class="no">nil</span><span class="p" data-group-id="5373225215-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Repo</span><span class="o">.</span><span class="n">insert_stream</span><span class="p" data-group-id="5373225215-11">(</span><span class="s">"ecto_ch_demo"</span><span class="p">,</span><span class="w"> </span><span class="n">rows</span><span class="p">,</span><span class="w"> </span><span class="ss">types</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="5373225215-12">[</span><span class="ss">a</span><span class="p">:</span><span class="w"> </span><span class="nc">Ch.Types</span><span class="o">.</span><span class="n">u64</span><span class="p" data-group-id="5373225215-13">(</span><span class="p" data-group-id="5373225215-13">)</span><span class="p">,</span><span class="w"> </span><span class="ss">b</span><span class="p">:</span><span class="w"> </span><span class="ss">:string</span><span class="p" data-group-id="5373225215-12">]</span><span class="p" data-group-id="5373225215-11">)</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="load/2">
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
<script src="dist/handlebars.runtime-NWIB6V2M.js"></script>
|
||||
<script src="dist/handlebars.templates-43PMFBC7.js"></script>
|
||||
<script src="dist/sidebar_items-846FE9F3.js"></script>
|
||||
<script src="dist/sidebar_items-91682BD9.js"></script>
|
||||
|
||||
<script src="docs_config.js"></script>
|
||||
|
||||
@ -246,13 +246,13 @@ Pages
|
||||
|
||||
</div>
|
||||
|
||||
<p>Extracts min/max date range from a list of uploads.</p><p>Examples:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">date_range</span><span class="p" data-group-id="8200550227-1">(</span><span class="p" data-group-id="8200550227-2">[</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="p" data-group-id="8200550227-3">%{</span><span class="s">"filename"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"imported_devices_20190101_20210101.csv"</span><span class="p" data-group-id="8200550227-3">}</span><span class="p">,</span><span class="w">
|
||||
<p>Extracts min/max date range from a list of uploads.</p><p>Examples:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">date_range</span><span class="p" data-group-id="9460237075-1">(</span><span class="p" data-group-id="9460237075-2">[</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="p" data-group-id="9460237075-3">%{</span><span class="s">"filename"</span><span class="w"> </span><span class="p">=></span><span class="w"> </span><span class="s">"imported_devices_20190101_20210101.csv"</span><span class="p" data-group-id="9460237075-3">}</span><span class="p">,</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="w"> </span><span class="s">"imported_pages_20200101_20220101.csv"</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="p" data-group-id="8200550227-2">]</span><span class="p" data-group-id="8200550227-1">)</span><span class="w">
|
||||
</span><span class="nc">Date</span><span class="o">.</span><span class="n">range</span><span class="p" data-group-id="8200550227-4">(</span><span class="ld">~D[2019-01-01]</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[2022-01-01]</span><span class="p" data-group-id="8200550227-4">)</span><span class="w">
|
||||
</span><span class="gp unselectable">...> </span><span class="p" data-group-id="9460237075-2">]</span><span class="p" data-group-id="9460237075-1">)</span><span class="w">
|
||||
</span><span class="nc">Date</span><span class="o">.</span><span class="n">range</span><span class="p" data-group-id="9460237075-4">(</span><span class="ld">~D[2019-01-01]</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[2022-01-01]</span><span class="p" data-group-id="9460237075-4">)</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="n">date_range</span><span class="p" data-group-id="8200550227-5">(</span><span class="p" data-group-id="8200550227-6">[</span><span class="p" data-group-id="8200550227-6">]</span><span class="p" data-group-id="8200550227-5">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="n">date_range</span><span class="p" data-group-id="9460237075-5">(</span><span class="p" data-group-id="9460237075-6">[</span><span class="p" data-group-id="9460237075-6">]</span><span class="p" data-group-id="9460237075-5">)</span><span class="w">
|
||||
</span><span class="no">nil</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -281,10 +281,10 @@ Pages
|
||||
|
||||
</div>
|
||||
|
||||
<p>Extracts the table name from the provided filename.</p><p>Raises if the filename doesn't conform to the expected format.</p><p>Examples:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">extract_table</span><span class="p" data-group-id="6751687521-1">(</span><span class="s">"my_data.csv"</span><span class="p" data-group-id="6751687521-1">)</span><span class="w">
|
||||
<p>Extracts the table name from the provided filename.</p><p>Raises if the filename doesn't conform to the expected format.</p><p>Examples:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">extract_table</span><span class="p" data-group-id="8630973142-1">(</span><span class="s">"my_data.csv"</span><span class="p" data-group-id="8630973142-1">)</span><span class="w">
|
||||
</span><span class="gt">** (ArgumentError) invalid filename</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="n">extract_table</span><span class="p" data-group-id="6751687521-2">(</span><span class="s">"imported_devices_00010101_20250101.csv"</span><span class="p" data-group-id="6751687521-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="n">extract_table</span><span class="p" data-group-id="8630973142-2">(</span><span class="s">"imported_devices_00010101_20250101.csv"</span><span class="p" data-group-id="8630973142-2">)</span><span class="w">
|
||||
</span><span class="s">"imported_devices"</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
@ -343,11 +343,11 @@ Pages
|
||||
|
||||
</div>
|
||||
|
||||
<p>Extracts table name and min/max dates from the filename.</p><p>Examples:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">parse_filename!</span><span class="p" data-group-id="8933933040-1">(</span><span class="s">"my_data.csv"</span><span class="p" data-group-id="8933933040-1">)</span><span class="w">
|
||||
<p>Extracts table name and min/max dates from the filename.</p><p>Examples:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">parse_filename!</span><span class="p" data-group-id="8573452773-1">(</span><span class="s">"my_data.csv"</span><span class="p" data-group-id="8573452773-1">)</span><span class="w">
|
||||
</span><span class="gt">** (ArgumentError) invalid filename</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="n">parse_filename!</span><span class="p" data-group-id="8933933040-2">(</span><span class="s">"imported_devices_00010101_20250101.csv"</span><span class="p" data-group-id="8933933040-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8933933040-3">{</span><span class="s">"imported_devices"</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[0001-01-01]</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[2025-01-01]</span><span class="p" data-group-id="8933933040-3">}</span></code></pre>
|
||||
</span><span class="gp unselectable">iex> </span><span class="n">parse_filename!</span><span class="p" data-group-id="8573452773-2">(</span><span class="s">"imported_devices_00010101_20250101.csv"</span><span class="p" data-group-id="8573452773-2">)</span><span class="w">
|
||||
</span><span class="p" data-group-id="8573452773-3">{</span><span class="s">"imported_devices"</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[0001-01-01]</span><span class="p">,</span><span class="w"> </span><span class="ld">~D[2025-01-01]</span><span class="p" data-group-id="8573452773-3">}</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
<section class="detail" id="valid_filename?/1">
|
||||
@ -375,10 +375,10 @@ Pages
|
||||
|
||||
</div>
|
||||
|
||||
<p>Checks if the provided filename conforms to the expected format.</p><p>Examples:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">valid_filename?</span><span class="p" data-group-id="3204013910-1">(</span><span class="s">"my_data.csv"</span><span class="p" data-group-id="3204013910-1">)</span><span class="w">
|
||||
<p>Checks if the provided filename conforms to the expected format.</p><p>Examples:</p><pre><code class="makeup elixir" translate="no"><span class="gp unselectable">iex> </span><span class="n">valid_filename?</span><span class="p" data-group-id="6851165351-1">(</span><span class="s">"my_data.csv"</span><span class="p" data-group-id="6851165351-1">)</span><span class="w">
|
||||
</span><span class="no">false</span><span class="w">
|
||||
|
||||
</span><span class="gp unselectable">iex> </span><span class="n">valid_filename?</span><span class="p" data-group-id="3204013910-2">(</span><span class="s">"imported_devices_00010101_20250101.csv"</span><span class="p" data-group-id="3204013910-2">)</span><span class="w">
|
||||
</span><span class="gp unselectable">iex> </span><span class="n">valid_filename?</span><span class="p" data-group-id="6851165351-2">(</span><span class="s">"imported_devices_00010101_20250101.csv"</span><span class="p" data-group-id="6851165351-2">)</span><span class="w">
|
||||
</span><span class="no">true</span></code></pre>
|
||||
</section>
|
||||
</section>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user