From d60f528251de906bb25caf974a5a41146a8ef397 Mon Sep 17 00:00:00 2001
From: vinibrsl
See
- Similar to Example: Similar to Example: The format of an Each language-range MAY be given an associated quality value which represents an
+ language-range = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" ) 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, would mean: "I prefer Danish, but will accept British English and other types of English." } Note that return value is not guaranteed to be a valid
+ Note that return value is not guaranteed to be a valid
number system for the given locale as demonstrated in the third example. To configure these transliteration pairs, add the to the Where each tuple in the list configures one transliteration map. In this example, two maps are
+ Where each tuple in the list configures one transliteration map. In this example, two maps are
configured: from A list of configurable number systems is returned by If a transliteration is requested between two number pairs that have not been configured for
precompilation, a warning is logged. It is also possible and recommended to use the It is also possible and recommended to use the When formatting a number the format is parsed into format elements that might include
+ 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.
@@ -1139,80 +1139,80 @@ inserted in the final formatted number. An error tuple Functions to implement the number system rule-based-number-format rules of CLDR. These rules are defined only on the "und" locale and represent specialised
number formatting. The standard public API for RBNF is via the 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: A rule can then be invoked on an available rule_set. For example This particular call is equivalent to the call through the public API of: A rule can then be invoked on an available rule_set. For example This particular call is equivalent to the call through the public API of: Functions to implement the ordinal rule-based-number-format rules of CLDR. As CLDR notes, the data is incomplete or non-existent for many languages. It
is considered complete for English however. The standard public API for RBNF is via the 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: A rule can then be invoked on an available rule_set. For example This call is equivalent to the call through the public API of: A rule can then be invoked on an available rule_set. For example This call is equivalent to the call through the public API of: Functions to implement the spellout rule-based-number-format rules of CLDR. As CLDR notes, the data is incomplete or non-existent for many languages. It
is considered complete for English however. The standard public API for RBNF is via the 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: A rule can then be invoked on an available rule_set. For example: This call is equivalent to the call through the public API of: A rule can then be invoked on an available rule_set. For example: This call is equivalent to the call through the public API of: See
- Similar to Example: Similar to Example: In the case of a DB-IP database: In the case of a MaxMind database: In the case of a DB-IP database: In the case of a MaxMind database: Loading from a local file: Downloading a MaxMind DB (this license key is no longer active): Loading from a local file: Downloading a MaxMind DB (this license key is no longer active): See
- Similar to Example: Similar to Example: See
- Similar to Example: Similar to Example: 8p=#eI!;NjL=$$B{dctKeG~x%5K^J1z|j!zoOCOS_RrKq{0NB9VtWA5t9nhRw2
zW{I<8^2XwEX28)^Q!B}UlbfWLkinsert_all/2
but with the following differences:Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
+
insert_all/2
but with the following differences:
+{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
-defmodule Demo do
+defmodule Demo do
use Ecto.Schema
@primary_key false
- schema "ecto_ch_demo" do
+ schema "ecto_ch_demo" do
field :a, Ch, type: "UInt64"
field :b, :string
- end
-end
+ end
+end
-rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
-{100_000, nil} = Repo.insert_stream(Demo, rows)
+rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
+{100_000, nil} = Repo.insert_stream(Demo, rows)
# schemaless
-{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
available_plans_for(user, opts \\ [])
-
+
View Source
@@ -296,7 +304,7 @@ Functions
business_plans_for(user)
-
+
View Source
@@ -318,7 +326,29 @@ Functions
business_tier?(subscription)
-
+
+
+ View Source
+
+
+
+ business_tier_launch()
+
+
View Source
@@ -340,7 +370,7 @@ Functions
find(product_id)
-
+
View Source
@@ -362,7 +392,7 @@ Functions
get_price_for(enterprise_plan)
-
+
View Source
@@ -386,7 +416,7 @@ Functions
get_regular_plan(subscription, opts \\ [])
-
+
View Source
@@ -408,7 +438,7 @@ Functions
get_subscription_plan(subscription)
-
+
View Source
@@ -430,7 +460,7 @@ Functions
growth_plans_for(user)
-
+
View Source
@@ -459,7 +489,7 @@ still choose from old plans.
latest_enterprise_plan_with_price(user)
-
+
View Source
@@ -481,7 +511,7 @@ still choose from old plans.
subscription_interval(subscription)
-
+
View Source
@@ -503,7 +533,7 @@ still choose from old plans.
suggest(user, usage_during_cycle)
-
+
View Source
@@ -536,7 +566,7 @@ plan's limit from the available options for the user.
suggest_tier(user)
-
+
View Source
@@ -558,7 +588,7 @@ plan's limit from the available options for the user.
with_prices(plans)
-
+
View Source
@@ -583,7 +613,7 @@ given plan and returns the new list of plans with completed information.
yearly_product_ids()
-
+
View Source
diff --git a/Plausible.Billing.Quota.html b/Plausible.Billing.Quota.html
index 5a07efe15..b88b8acb2 100644
--- a/Plausible.Billing.Quota.html
+++ b/Plausible.Billing.Quota.html
@@ -13,7 +13,7 @@
-
+
@@ -283,7 +283,7 @@ Functions
allowed_features_for(user)
-
+
View Source
@@ -306,7 +306,7 @@ ability to use all features during their trial.
below_limit?(usage, limit)
-
+
View Source
@@ -335,7 +335,7 @@ Returns false if usage is equal to the limit.
ensure_can_subscribe_to_plan(user, plan)
-
+
View Source
@@ -357,7 +357,7 @@ Returns false if usage is equal to the limit.
exceeded_limits(usage, plan)
-
+
View Source
@@ -379,7 +379,7 @@ Returns false if usage is equal to the limit.
features_usage(user)
-
+
View Source
@@ -409,7 +409,7 @@ usage for are Props
, Funnels
monthly_pageview_limit(subscription)
-
+
View Source
@@ -438,7 +438,7 @@ usage for are Props
, Funnels
monthly_pageview_usage(user)
-
+
View Source
@@ -496,7 +496,7 @@ background job so as to avoid service disruption.
site_usage(user)
-
+
View Source
@@ -524,7 +524,7 @@ background job so as to avoid service disruption.
team_member_limit(user)
-
+
View Source
@@ -552,7 +552,7 @@ background job so as to avoid service disruption.
team_member_usage(user)
-
+
View Source
@@ -605,7 +605,7 @@ with the user's sites.
within_limit?(usage, limit)
-
+
View Source
diff --git a/Plausible.Billing.SiteLocker.html b/Plausible.Billing.SiteLocker.html
index d763acd69..4c5498ed4 100644
--- a/Plausible.Billing.SiteLocker.html
+++ b/Plausible.Billing.SiteLocker.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Billing.Subscription.Status.html b/Plausible.Billing.Subscription.Status.html
index bcacb1abe..68672ec8b 100644
--- a/Plausible.Billing.Subscription.Status.html
+++ b/Plausible.Billing.Subscription.Status.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Billing.html b/Plausible.Billing.html
index 7855d6880..704edc576 100644
--- a/Plausible.Billing.html
+++ b/Plausible.Billing.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.ChangesetHelpers.html b/Plausible.ChangesetHelpers.html
index 2d74dc3c7..a1c4a08c9 100644
--- a/Plausible.ChangesetHelpers.html
+++ b/Plausible.ChangesetHelpers.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Cldr.AcceptLanguage.html b/Plausible.Cldr.AcceptLanguage.html
index a6716a92b..4b0b2bea7 100644
--- a/Plausible.Cldr.AcceptLanguage.html
+++ b/Plausible.Cldr.AcceptLanguage.html
@@ -13,7 +13,7 @@
-
+
@@ -119,7 +119,7 @@ Plausible
the set of natural languages that are preferred as a response to the request.
Language tags function are provided in Cldr.LanguageTag
.Accept-Language
header is as follows in ABNF
format: Accept-Language = "Accept-Language" ":"
1#( language-range [ ";" "q" "=" qvalue ] )
- language-range = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
Accept-Language: da, en-gb;q=0.8, en;q=0.7
iex> Plausible.Cldr.AcceptLanguage.best_match("da;q=0.1,zh-TW;q=0.3", TestBackend.Cldr)
-{:ok,
- %Cldr.LanguageTag{
+
+iex> Plausible.Cldr.AcceptLanguage.best_match("invalid_tag")
+{:error, {Cldr.LanguageTag.ParseError,
+ "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}iex> Plausible.Cldr.AcceptLanguage.best_match("da;q=0.1,zh-TW;q=0.3", TestBackend.Cldr)
+{:ok,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "zh-TW",
cldr_locale_name: :"zh-Hant",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "zh",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :"zh-Hant",
requested_locale_name: "zh-TW",
script: :Hant,
territory: :TW,
- transform: %{},
- language_variants: []
- }}
+ transform: %{},
+ language_variants: []
+ }}
-iex> Plausible.Cldr.AcceptLanguage.best_match("da;q=0.1,zh-TW;q=0.3", TestBackend.Cldr)
-{:ok,
- %Cldr.LanguageTag{
+iex> Plausible.Cldr.AcceptLanguage.best_match("da;q=0.1,zh-TW;q=0.3", TestBackend.Cldr)
+{:ok,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "zh-TW",
cldr_locale_name: :"zh-Hant",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "zh",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :"zh-Hant",
requested_locale_name: "zh-TW",
script: :Hant,
territory: :TW,
- transform: %{},
- language_variants: []
- }}
+ transform: %{},
+ language_variants: []
+ }}
-iex> Plausible.Cldr.AcceptLanguage.best_match("xx,yy;q=0.3")
-{:error,
- {Cldr.NoMatchingLocale,
- "No configured locale could be matched to \"xx,yy;q=0.3\""}}
+iex> Plausible.Cldr.AcceptLanguage.best_match("xx,yy;q=0.3")
+{:error,
+ {Cldr.NoMatchingLocale,
+ "No configured locale could be matched to \"xx,yy;q=0.3\""}}
-iex> Plausible.Cldr.AcceptLanguage.best_match("invalid_tag")
-{:error, {Cldr.LanguageTag.ParseError,
- "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
-iex> Cldr.AcceptLanguage.parse("da,zh-TW;q=0.3", TestBackend.Cldr)
-{:ok,
- [
- {1.0,
- %Cldr.LanguageTag{
+
+ transform: %{},
+ language_variants: []
+ }},
+ {:error,
+ {Cldr.LanguageTag.ParseError,
+ "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
+ ]}iex> Cldr.AcceptLanguage.parse("da,zh-TW;q=0.3", TestBackend.Cldr)
+{:ok,
+ [
+ {1.0,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "da",
cldr_locale_name: :da,
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "da",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :da,
requested_locale_name: "da",
script: :Latn,
territory: :DK,
- transform: %{},
- language_variants: []
- }},
- {0.3,
- %Cldr.LanguageTag{
+ transform: %{},
+ language_variants: []
+ }},
+ {0.3,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "zh-TW",
cldr_locale_name: :"zh-Hant",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "zh",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :"zh-Hant",
requested_locale_name: "zh-TW",
script: :Hant,
territory: :TW,
- transform: %{},
- language_variants: []
- }}
- ]}
+ transform: %{},
+ language_variants: []
+ }}
+ ]}
-iex> Plausible.Cldr.AcceptLanguage.parse("invalid_tag")
-{:error,
- {Cldr.LanguageTag.ParseError,
- "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
+iex> Plausible.Cldr.AcceptLanguage.parse("invalid_tag")
+{:error,
+ {Cldr.LanguageTag.ParseError,
+ "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
-iex> Plausible.Cldr.AcceptLanguage.parse("da,zh-TW;q=0.3,invalid_tag")
-{:ok,
- [
- {1.0,
- %Cldr.LanguageTag{
+iex> Plausible.Cldr.AcceptLanguage.parse("da,zh-TW;q=0.3,invalid_tag")
+{:ok,
+ [
+ {1.0,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "da",
cldr_locale_name: :da,
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "da",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :da,
requested_locale_name: "da",
script: :Latn,
territory: :DK,
- transform: %{},
- language_variants: []
- }},
- {0.3,
- %Cldr.LanguageTag{
+ transform: %{},
+ language_variants: []
+ }},
+ {0.3,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "zh-TW",
cldr_locale_name: :"zh-Hant",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "zh",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :"zh-Hant",
requested_locale_name: "zh-TW",
script: :Hant,
territory: :TW,
- transform: %{},
- language_variants: []
- }},
- {:error,
- {Cldr.LanguageTag.ParseError,
- "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
- ]}
-iex> Plausible.Cldr.AcceptLanguage.parse!("da,zh-TW;q=0.3")
-[
- {1.0,
- %Cldr.LanguageTag{
+
+ transform: %{},
+ language_variants: []
+ }},
+ {:error,
+ {Cldr.LanguageTag.ParseError,
+ "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
+]iex> Plausible.Cldr.AcceptLanguage.parse!("da,zh-TW;q=0.3")
+[
+ {1.0,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "da",
cldr_locale_name: :da,
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "da",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :da,
requested_locale_name: "da",
script: :Latn,
territory: :DK,
- transform: %{},
- language_variants: []
- }},
- {0.3,
- %Cldr.LanguageTag{
+ transform: %{},
+ language_variants: []
+ }},
+ {0.3,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "zh-TW",
cldr_locale_name: :"zh-Hant",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "zh",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :"zh-Hant",
requested_locale_name: "zh-TW",
script: :Hant,
territory: :TW,
- transform: %{},
- language_variants: []
- }}
-]
+ transform: %{},
+ language_variants: []
+ }}
+]
Plausible.Cldr.AcceptLanguage.parse! "invalid_tag"
** (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
-iex> Plausible.Cldr.AcceptLanguage.parse!("da,zh-TW;q=0.3,invalid_tag")
-[
- {1.0,
- %Cldr.LanguageTag{
+iex> Plausible.Cldr.AcceptLanguage.parse!("da,zh-TW;q=0.3,invalid_tag")
+[
+ {1.0,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "da",
cldr_locale_name: :da,
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "da",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :da,
requested_locale_name: "da",
script: :Latn,
territory: :DK,
- transform: %{},
- language_variants: []
- }},
- {0.3,
- %Cldr.LanguageTag{
+ transform: %{},
+ language_variants: []
+ }},
+ {0.3,
+ %Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "zh-TW",
cldr_locale_name: :"zh-Hant",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: nil,
language: "zh",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :"zh-Hant",
requested_locale_name: "zh-TW",
script: :Hant,
territory: :TW,
- transform: %{},
- language_variants: []
- }},
- {:error,
- {Cldr.LanguageTag.ParseError,
- "Expected a BCP47 language tag. Could not parse the remaining \"g\" starting at position 11"}}
-]
:all
. See FJD: %Cldr.Currency{
+ %{
@@ -470,11 +470,11 @@ The default is FJD: %Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "FJD",
- count: %{one: "Fijian dollar", other: "Fijian dollars"},
+ count: %{one: "Fijian dollar", other: "Fijian dollars"},
digits: 2,
from: nil,
iso_digits: 2,
@@ -404,12 +404,12 @@ The default is
:all
. See symbol: "FJD",
tender: true,
to: nil
- },
- SUR: %Cldr.Currency{
+ },
+ SUR: %Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "SUR",
- count: %{one: "Soviet rouble", other: "Soviet roubles"},
+ count: %{one: "Soviet rouble", other: "Soviet roubles"},
digits: 2,
from: nil,
iso_digits: nil,
@@ -419,7 +419,7 @@ The default is :all
. See symbol: "SUR",
tender: true,
to: nil
- },
+ },
...
}}:all
. See FJD: %Cldr.Currency{
+ => %{FJD: %Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "FJD",
- count: %{one: "Fijian dollar", other: "Fijian dollars"},
+ count: %{one: "Fijian dollar", other: "Fijian dollars"},
digits: 2,
from: nil,
iso_digits: 2,
@@ -484,12 +484,12 @@ The default is
:all
. See symbol: "FJD",
tender: true,
to: nil
-},
-SUR: %Cldr.Currency{
+},
+SUR: %Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "SUR",
- count: %{one: "Soviet rouble", other: "Soviet roubles"},
+ count: %{one: "Soviet rouble", other: "Soviet roubles"},
digits: 2,
from: nil,
iso_digits: nil,
@@ -499,7 +499,7 @@ The default is :all
. See symbol: "SUR",
tender: true,
to: nil
-},
+},
...
-
+ }}iex> Plausible.Cldr.Currency.currency_for_code("AUD")
-{:ok,
- %Cldr.Currency{
+
+}}iex> Plausible.Cldr.Currency.currency_for_code("AUD")
+{:ok,
+ %Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "AUD",
- count: %{one: "Australian dollar", other: "Australian dollars"},
+ count: %{one: "Australian dollar", other: "Australian dollars"},
digits: 2,
iso_digits: 2,
name: "Australian Dollar",
@@ -571,15 +571,15 @@ or a
rounding: 0,
symbol: "A$",
tender: true
-}}
+}}
-iex> Plausible.Cldr.Currency.currency_for_code("THB")
-{:ok,
- %Cldr.Currency{
+iex> Plausible.Cldr.Currency.currency_for_code("THB")
+{:ok,
+ %Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "THB",
- count: %{one: "Thai baht", other: "Thai baht"},
+ count: %{one: "Thai baht", other: "Thai baht"},
digits: 2,
iso_digits: 2,
name: "Thai Baht",
@@ -587,7 +587,7 @@ or a
rounding: 0,
symbol: "THB",
tender: true
-}}
-
iex> Plausible.Cldr.Currency.currency_for_code!("AUD")
-%Cldr.Currency{
+
+}iex> Plausible.Cldr.Currency.currency_for_code!("AUD")
+%Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "AUD",
- count: %{one: "Australian dollar", other: "Australian dollars"},
+ count: %{one: "Australian dollar", other: "Australian dollars"},
digits: 2,
iso_digits: 2,
name: "Australian Dollar",
@@ -659,14 +659,14 @@ or a
rounding: 0,
symbol: "A$",
tender: true
-}
+}
-iex> Plausible.Cldr.Currency.currency_for_code!("THB")
-%Cldr.Currency{
+iex> Plausible.Cldr.Currency.currency_for_code!("THB")
+%Cldr.Currency{
cash_digits: 2,
cash_rounding: 0,
code: "THB",
- count: %{one: "Thai baht", other: "Thai baht"},
+ count: %{one: "Thai baht", other: "Thai baht"},
digits: 2,
iso_digits: 2,
name: "Thai Baht",
@@ -674,7 +674,7 @@ or a
rounding: 0,
symbol: "THB",
tender: true
-}
-
iex> {:ok, locale} = Plausible.Cldr.validate_locale "en"
+
iex> {:ok, locale} = Plausible.Cldr.validate_locale "en"
iex> Plausible.Cldr.Currency.currency_from_locale locale
:USD
-iex> {:ok, locale} = Plausible.Cldr.validate_locale "en-AU"
+iex> {:ok, locale} = Plausible.Cldr.validate_locale "en-AU"
iex> Plausible.Cldr.Currency.currency_from_locale locale
:AUD
@@ -768,13 +768,13 @@ or a
{:ok,
+ %{
+ USD: %{from: ~D[1792-01-01], to: nil},
+ USN: %{tender: false},
+ USS: %{from: nil, tender: false, to: ~D[2014-03-01]}
+ }
+}
+iex> MyApp.Cldr.Currency.currency_history_for_locale "en"
-{:ok,
- %{
- USD: %{from: ~D[1792-01-01], to: nil},
- USN: %{tender: false},
- USS: %{from: nil, tender: false, to: ~D[2014-03-01]}
- }
-}
:all
. See MyApp.Cldr.Currency.currency_strings "en"
-=> {:ok,
- %{
+=> {:ok,
+ %{
"mexican silver pesos" => :MXP,
"sudanese dinar" => :SDD,
"bad" => :BAD,
@@ -845,7 +845,7 @@ The default is :all
. See "guyanaese dollars" => :GYD,
"equatorial guinean ekwele" => :GQE,
...
- }}:all
. See MyApp.Cldr.Currency.currency_strings! "en"
-=> %{
+=> %{
"mexican silver pesos" => :MXP,
"sudanese dinar" => :SDD,
"bad" => :BAD,
@@ -915,7 +915,7 @@ The default is :all
. See "guyanaese dollars" => :GYD,
"equatorial guinean ekwele" => :GQE,
...
- }
+ }
iex> Plausible.Cldr.Currency.current_territory_currencies()
+
iex> Plausible.Cldr.Currency.current_territory_currencies()
iex> Plausible.Cldr.Currency.known_currency_code "AUD"
-{:ok, :AUD}
+{:ok, :AUD}
iex> Plausible.Cldr.Currency.known_currency_code "GGG"
-{:error, {Cldr.UnknownCurrencyError, "The currency \"GGG\" is invalid"}}
+{:error, {Cldr.UnknownCurrencyError, "The currency \"GGG\" is invalid"}}
0.05
. Optional.iex> Plausible.Cldr.Currency.new(:XAE, name: "Custom Name", digits: 0)
-{:ok,
- %Cldr.Currency{
+
+ }}
+iex> MyApp.Cldr.Currency.new(:XAH, name: "Custom Name")
+{:error, "Required options are missing. Required options are [:name, :digits]"}
+iex> Plausible.Cldr.Currency.new(:XAE, name: "XAE", digits: 0)
+{:error, {Cldr.CurrencyAlreadyDefined, "Currency :XAE is already defined."}}
iex> Plausible.Cldr.Currency.new(:XAE, name: "Custom Name", digits: 0)
+{:ok,
+ %Cldr.Currency{
alt_code: :XAE,
cash_digits: 0,
cash_rounding: nil,
code: :XAE,
- count: %{other: "Custom Name"},
+ count: %{other: "Custom Name"},
digits: 0,
from: nil,
iso_digits: 0,
@@ -1264,11 +1264,11 @@ such as
0.05
. Optional.symbol
: "XAE",
tender: false,
to: nil
- }}
-iex> MyApp.Cldr.Currency.new(:XAH, name: "Custom Name")
-{:error, "Required options are missing. Required options are [:name, :digits]"}
-iex> Plausible.Cldr.Currency.new(:XAE, name: "XAE", digits: 0)
-{:error, {Cldr.CurrencyAlreadyDefined, "Currency :XAE is already defined."}}Plaus
+{:ok, "dollar des États-Unis"}
iex> Plausible.Cldr.Currency.pluralize 1, :USD
-{:ok, "US dollar"}
+{:ok, "US dollar"}
iex> Plausible.Cldr.Currency.pluralize 3, :USD
-{:ok, "US dollars"}
+{:ok, "US dollars"}
iex> Plausible.Cldr.Currency.pluralize 12, :USD, locale: "zh"
-{:ok, "美元"}
+{:ok, "美元"}
iex> Plausible.Cldr.Currency.pluralize 12, :USD, locale: "fr"
-{:ok, "dollars des États-Unis"}
+{:ok, "dollars des États-Unis"}
iex> Plausible.Cldr.Currency.pluralize 1, :USD, locale: "fr"
-{:ok, "dollar des États-Unis"}
+["a$", "australian dollars", "aud", "australian dollar"]iex> MyApp.Cldr.Currency.strings_for_currency :AUD, "en"
-["a$", "australian dollars", "aud", "australian dollar"]
iex> Plausible.Cldr.Locale.fallback_locale_names(:"fr-CA")
-{:ok, [:"fr-CA", :fr, :und]}
+
-
+iex> Plausible.Cldr.Locale.fallback_locale_names(:nb)
+{:ok, [:nb, :no, :und]}
iex> Plausible.Cldr.Locale.fallback_locale_names(:"fr-CA")
+{:ok, [:"fr-CA", :fr, :und]}
# Fallbacks are typically formed by progressively
# stripping variant, territory and script from the
# given locale name. But not always - there are
# certain fallbacks that take a different path.
-iex> Plausible.Cldr.Locale.fallback_locale_names(:nb)
-{:ok, [:nb, :no, :und]}
Plausible.Cldr.Locale.fallback_locales(:"fr-CA")
-=> {:ok,
- [#Cldr.LanguageTag<fr-CA [validated]>, #Cldr.LanguageTag<fr [validated]>,
- #Cldr.LanguageTag<und [validated]>]}
+
+Plausible.Cldr.Locale.fallback_locales(:nb))
+=> {:ok,
+ [#Cldr.LanguageTag<nb [validated]>, #Cldr.LanguageTag<no [validated]>,
+ #Cldr.LanguageTag<und [validated]>]}
Plausible.Cldr.Locale.fallback_locales(:"fr-CA")
+=> {:ok,
+ [#Cldr.LanguageTag<fr-CA [validated]>, #Cldr.LanguageTag<fr [validated]>,
+ #Cldr.LanguageTag<und [validated]>]}
# Fallbacks are typically formed by progressively
# stripping variant, territory and script from the
# given locale name. But not always - there are
# certain fallbacks that take a different path.
-Plausible.Cldr.Locale.fallback_locales(:nb))
-=> {:ok,
- [#Cldr.LanguageTag<nb [validated]>, #Cldr.LanguageTag<no [validated]>,
- #Cldr.LanguageTag<und [validated]>]}
iex> Plausible.Cldr.Locale.locale_from_host "a.b.com.au"
-Elixir.Plausible.Cldr.validate_locale(:"en-AU")
+Elixir.Plausible.Cldr.validate_locale(:"en-AU")
-iex> Plausible.Cldr.Locale.locale_from_host("a.b.com.tv")
-{:error,
- {Cldr.UnknownLocaleError, "No locale was identified for territory \"tv\""}}
+iex> Plausible.Cldr.Locale.locale_from_host("a.b.com.tv")
+{:error,
+ {Cldr.UnknownLocaleError, "No locale was identified for territory \"tv\""}}
-iex> Plausible.Cldr.Locale.locale_from_host("a.b.com")
-{:error,
- {Cldr.UnknownLocaleError, "No locale was identified for territory \"com\""}}
+iex> Plausible.Cldr.Locale.locale_from_host("a.b.com")
+{:error,
+ {Cldr.UnknownLocaleError, "No locale was identified for territory \"com\""}}
iex> Cldr.Locale.territory_from_host("a.b.com.au")
-{:ok, :AU}
+
+iex> Cldr.Locale.territory_from_host("a.b.com")
+{:error,
+ {Cldr.UnknownLocaleError, "No locale was identified for territory \"com\""}}
iex> Cldr.Locale.territory_from_host("a.b.com.au")
+{:ok, :AU}
-iex> Cldr.Locale.territory_from_host("a.b.com")
-{:error,
- {Cldr.UnknownLocaleError, "No locale was identified for territory \"com\""}}
:zero
, iex> Plausible.Cldr.Number.Cardinal.pluralize 1, "en", %{one: "one"}
+
iex> Plausible.Cldr.Number.Cardinal.pluralize 1, "en", %{one: "one"}
"one"
-iex> Plausible.Cldr.Number.Cardinal.pluralize 2, "en", %{one: "one"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 2, "en", %{one: "one"}
nil
-iex> Plausible.Cldr.Number.Cardinal.pluralize 2, "en", %{one: "one", two: "two", other: "other"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 2, "en", %{one: "one", two: "two", other: "other"}
"other"
-iex> Plausible.Cldr.Number.Cardinal.pluralize 22, "en", %{one: "one", two: "two", other: "other"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 22, "en", %{one: "one", two: "two", other: "other"}
"other"
-iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(1), "en", %{one: "one"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(1), "en", %{one: "one"}
"one"
-iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(2), "en", %{one: "one"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(2), "en", %{one: "one"}
nil
-iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(2), "en", %{one: "one", two: "two"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize Decimal.new(2), "en", %{one: "one", two: "two"}
nil
-iex> Plausible.Cldr.Number.Cardinal.pluralize 1..10, "ar", %{one: "one", few: "few", other: "other"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 1..10, "ar", %{one: "one", few: "few", other: "other"}
"few"
-iex> Plausible.Cldr.Number.Cardinal.pluralize 1..10, "en", %{one: "one", few: "few", other: "other"}
+iex> Plausible.Cldr.Number.Cardinal.pluralize 1..10, "en", %{one: "one", few: "few", other: "other"}
"other"
#=> Plausible.Cldr.Number.Format.Format.decimal_format_list
-["#", "#,##,##0%",
+["#", "#,##,##0%",
"#,##,##0.###", "#,##,##0.00¤", "#,##,##0.00¤;(#,##,##0.00¤)",
"#,##,##0 %", "#,##0%", "#,##0.###", "#,##0.00 ¤",
"#,##0.00 ¤;(#,##0.00 ¤)", "#,##0.00¤", "#,##0.00¤;(#,##0.00¤)",
@@ -449,7 +449,7 @@ to precompile all the known formats at compile time.
-"000 B ¤"
, "000 E ¤", "000 K ¤", "000 MRD ¤", "000 Md ¤", "000 Mio'.' ¤",
"000 Mio ¤", "000 Mld ¤", "000 Mln ¤", "000 Mn ¤", "000 Mrd'.' ¤",
"000 Mrd ¤", "000 Mr ¤", "000 M ¤", "000 NT ¤", "000 N ¤", "000 Tn ¤",
-"000 Tr ¤", ...]
+"000 Tr ¤", ...]
-iex> Plausible.Cldr.Number.Format.decimal_format_list_for(:en)
-{:ok, ["#,##0%", "#,##0.###", "#,##0.00", "#,##0.00;(#,##0.00)","#E0",
+
+ "¤ 000T", "¤ 00B", "¤ 00K", "¤ 00M", "¤ 00T", "¤ 0B", "¤ 0K", "¤ 0M", "¤ 0T"]}iex> Plausible.Cldr.Number.Format.decimal_format_list_for(:en)
+{:ok, ["#,##0%", "#,##0.###", "#,##0.00", "#,##0.00;(#,##0.00)","#E0",
"0 billion", "0 million", "0 thousand",
"0 trillion", "00 billion", "00 million", "00 thousand", "00 trillion",
"000 billion", "000 million", "000 thousand", "000 trillion", "000B", "000K",
@@ -506,7 +506,7 @@ the known formats at compile time. Its use is not otherwise recommended.
"¤#,##0.00", "¤#,##0.00;(¤#,##0.00)", "¤000B", "¤000K", "¤000M",
"¤000T", "¤00B", "¤00K", "¤00M", "¤00T", "¤0B", "¤0K", "¤0M", "¤0T",
"¤ #,##0.00", "¤ #,##0.00;(¤ #,##0.00)", "¤ 000B", "¤ 000K", "¤ 000M",
- "¤ 000T", "¤ 00B", "¤ 00K", "¤ 00M", "¤ 00T", "¤ 0B", "¤ 0K", "¤ 0M", "¤ 0T"]}
Plausible.Cld
Examples
+iex> Plausible.Cldr.Number.Format.default_grouping_for(:en)
-{:ok, %{fraction: %{first: 0, rest: 0}, integer: %{first: 3, rest: 3}}}
iex> Plausible.Cldr.Number.Format.default_grouping_for(:en)
+{:ok, %{fraction: %{first: 0, rest: 0}, integer: %{first: 3, rest: 3}}}
Plausible.Cld
Examples
+iex> Plausible.Cldr.Number.Format.default_grouping_for!(:en)
-%{fraction: %{first: 0, rest: 0}, integer: %{first: 3, rest: 3}}
iex> Plausible.Cldr.Number.Format.default_grouping_for!(:en)
+%{fraction: %{first: 0, rest: 0}, integer: %{first: 3, rest: 3}}
percent: "#,##0 %",
scientific: "#E0",
standard: "#,##0.###"
- currency_short: [{"1000", [one: "0 k ¤", other: "0 k ¤"]},
- {"10000", [one: "00 k ¤", other: "00 k ¤"]},
- {"100000", [one: "000 k ¤", other: "000 k ¤"]},
- {"1000000", [one: "0 M ¤", other: "0 M ¤"]},
- {"10000000", [one: "00 M ¤", other: "00 M ¤"]},
- {"100000000", [one: "000 M ¤", other: "000 M ¤"]},
- {"1000000000", [one: "0 Md ¤", other: "0 Md ¤"]},
- {"10000000000", [one: "00 Md ¤", other: "00 Md ¤"]},
- {"100000000000", [one: "000 Md ¤", other: "000 Md ¤"]},
- {"1000000000000", [one: "0 Bn ¤", other: "0 Bn ¤"]},
- {"10000000000000", [one: "00 Bn ¤", other: "00 Bn ¤"]},
- {"100000000000000", [one: "000 Bn ¤", other: "000 Bn ¤"]}],
+ currency_short: [{"1000", [one: "0 k ¤", other: "0 k ¤"]},
+ {"10000", [one: "00 k ¤", other: "00 k ¤"]},
+ {"100000", [one: "000 k ¤", other: "000 k ¤"]},
+ {"1000000", [one: "0 M ¤", other: "0 M ¤"]},
+ {"10000000", [one: "00 M ¤", other: "00 M ¤"]},
+ {"100000000", [one: "000 M ¤", other: "000 M ¤"]},
+ {"1000000000", [one: "0 Md ¤", other: "0 Md ¤"]},
+ {"10000000000", [one: "00 Md ¤", other: "00 Md ¤"]},
+ {"100000000000", [one: "000 Md ¤", other: "000 Md ¤"]},
+ {"1000000000000", [one: "0 Bn ¤", other: "0 Bn ¤"]},
+ {"10000000000000", [one: "00 Bn ¤", other: "00 Bn ¤"]},
+ {"100000000000000", [one: "000 Bn ¤", other: "000 Bn ¤"]}],
...
}
Plausible.Cld
Examples
-
+iex> Plausible.Cldr.Number.Format.minimum_grouping_digits_for("en")
-{:ok, 1}
iex> Plausible.Cldr.Number.Format.minimum_grouping_digits_for("en")
+{:ok, 1}
Plausible.Cld
Examples
-iex> Plausible.Cldr.Number.Format.minimum_grouping_digits_for!("en")
+
iex> Plausible.Cldr.Number.Format.minimum_grouping_digits_for!("en")
1
:zero
, iex> Plausible.Cldr.Number.Ordinal.pluralize 1, :en, %{one: "one"}
+
+ {Cldr.UnknownNumberSystemError,
+ "The number system :finance is unknown for the locale named :en. Valid number systems are %{default: :latn, native: :latn}"}
+}
diff --git a/Plausible.Cldr.Number.PluralRule.Range.html b/Plausible.Cldr.Number.PluralRule.Range.html
index ad1450009..e6f7fbd25 100644
--- a/Plausible.Cldr.Number.PluralRule.Range.html
+++ b/Plausible.Cldr.Number.PluralRule.Range.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Cldr.Number.Symbol.html b/Plausible.Cldr.Number.Symbol.html
index cc429534d..9394e8ac0 100644
--- a/Plausible.Cldr.Number.Symbol.html
+++ b/Plausible.Cldr.Number.Symbol.html
@@ -13,7 +13,7 @@
-
+
@@ -349,9 +349,9 @@ is iex> Plausible.Cldr.Number.Ordinal.pluralize 1, :en, %{one: "one"}
"one"
-iex> Plausible.Cldr.Number.Ordinal.pluralize 2, :en, %{one: "one"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 2, :en, %{one: "one"}
nil
-iex> Plausible.Cldr.Number.Ordinal.pluralize 2, :en, %{one: "one", two: "two"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 2, :en, %{one: "one", two: "two"}
"two"
-iex> Plausible.Cldr.Number.Ordinal.pluralize 22, :en, %{one: "one", two: "two", other: "other"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 22, :en, %{one: "one", two: "two", other: "other"}
"two"
-iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(1), :en, %{one: "one"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(1), :en, %{one: "one"}
"one"
-iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(2), :en, %{one: "one"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(2), :en, %{one: "one"}
nil
-iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(2), :en, %{one: "one", two: "two"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize Decimal.new(2), :en, %{one: "one", two: "two"}
"two"
-iex> Plausible.Cldr.Number.Ordinal.pluralize 1..10, "ar", %{one: "one", few: "few", other: "other"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 1..10, "ar", %{one: "one", few: "few", other: "other"}
"other"
-iex> Plausible.Cldr.Number.Ordinal.pluralize 1..10, "en", %{one: "one", few: "few", other: "other"}
+iex> Plausible.Cldr.Number.Ordinal.pluralize 1..10, "en", %{one: "one", few: "few", other: "other"}
"other"
Plausible.Cld
Example:
-iex> Plausible.Cldr.Number.Symbol.number_symbols_for(:th)
-{:ok, %{
- latn: %Cldr.Number.Symbol{
+
+ }
+ }}iex> Plausible.Cldr.Number.Symbol.number_symbols_for(:th)
+{:ok, %{
+ latn: %Cldr.Number.Symbol{
decimal: ".",
exponential: "E",
group: ",",
@@ -364,8 +364,8 @@ is
Plausible.Cld
plus_sign: "+",
superscripting_exponent: "×",
time_separator: ":"
- },
- thai: %Cldr.Number.Symbol{
+ },
+ thai: %Cldr.Number.Symbol{
decimal: ".",
exponential: "E",
group: ",",
@@ -378,8 +378,8 @@ is Plausible.Cld
plus_sign: "+",
superscripting_exponent: "×",
time_separator: ":"
- }
- }}iex> Plausible.Cldr.Number.System.number_system_for "th", :latn
-{:ok, %{digits: "0123456789", type: :numeric}}
+{:ok, %{digits: "0123456789", type: :numeric}}
iex> Plausible.Cldr.Number.System.number_system_for "en", :default
-{:ok, %{digits: "0123456789", type: :numeric}}
+{:ok, %{digits: "0123456789", type: :numeric}}
iex> Plausible.Cldr.Number.System.number_system_for "he", :traditional
-{:ok, %{rules: "hebrew", type: :algorithmic}}
+{:ok, %{rules: "hebrew", type: :algorithmic}}
iex> Plausible.Cldr.Number.System.number_system_for "en", :native
-{:ok, %{digits: "0123456789", type: :numeric}}
+{:ok, %{digits: "0123456789", type: :numeric}}
iex> Plausible.Cldr.Number.System.number_system_for "en", :finance
-{
+{
:error,
- {Cldr.UnknownNumberSystemError,
- "The number system :finance is unknown for the locale named :en. Valid number systems are %{default: :latn, native: :latn}"}
-}
+{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}iex> Plausible.Cldr.Number.System.number_system_names_for "en"
-{:ok, [:latn]}
+{:ok, [:latn]}
iex> Plausible.Cldr.Number.System.number_system_names_for "zz"
-{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}
+{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}iex> Plausible.Cldr.Number.System.number_systems_for "en"
-{:ok, %{default: :latn, native: :latn}}
+{:ok, %{default: :latn, native: :latn}}
iex> Plausible.Cldr.Number.System.number_systems_for "th"
-{:ok, %{default: :latn, native: :thai}}
+{:ok, %{default: :latn, native: :thai}}
iex> Plausible.Cldr.Number.System.number_systems_for "zz"
-{:error, {Cldr.InvalidLanguageError, "The language \"zz\" is invalid"}}
ex> Plausible.Cldr.Number.System.system_name_from(:default, "en")
-{:ok, :latn}
+
ex> Plausible.Cldr.Number.System.system_name_from(:default, "en")
+{:ok, :latn}
-iex> Plausible.Cldr.Number.System.system_name_from("latn", "en")
-{:ok, :latn}
+iex> Plausible.Cldr.Number.System.system_name_from("latn", "en")
+{:ok, :latn}
-iex> Plausible.Cldr.Number.System.system_name_from(:native, "en")
-{:ok, :latn}
+iex> Plausible.Cldr.Number.System.system_name_from(:native, "en")
+{:ok, :latn}
-iex> Plausible.Cldr.Number.System.system_name_from(:nope, "en")
-{
+iex> Plausible.Cldr.Number.System.system_name_from(:nope, "en")
+{
:error,
- {Cldr.UnknownNumberSystemError, "The number system :nope is unknown"}
-}
iex> Plausible.Cldr.Number.System.to_system 123456, :hebr
-{:ok, "קכ״ג׳תנ״ו"}
+{:ok, "קכ״ג׳תנ״ו"}
iex> Plausible.Cldr.Number.System.to_system 123, :hans
-{:ok, "一百二十三"}
+{:ok, "一百二十三"}
iex> Plausible.Cldr.Number.System.to_system 123, :hant
-{:ok, "一百二十三"}
+{:ok, "一百二十三"}
iex> Plausible.Cldr.Number.System.to_system 123, :hansfin
-{:ok, "壹佰贰拾叁"}
+{:ok, "壹佰贰拾叁"}
-use Cldr
configuration
-in a backend module:defmodule MyApp.Cldr do
+in a backend module:
defmodule MyApp.Cldr do
use Cldr,
- locale: ["en", "fr", "th"],
+ locale: ["en", "fr", "th"],
default_locale: "en",
- precompile_transliterations: [{:latn, :thai}, {:arab, :thai}]
-end
:latn
to :thai
and from :arab
to :thai
.Cldr.Number.System.systems_with_digits/0
.
iex> Plausible.Cldr.Number.Transliterate.transliterate("123556")
+
diff --git a/Plausible.Cldr.Number.html b/Plausible.Cldr.Number.html
index 34e86f3e8..e50875715 100644
--- a/Plausible.Cldr.Number.html
+++ b/Plausible.Cldr.Number.html
@@ -13,7 +13,7 @@
-
+
@@ -412,19 +412,19 @@ using the Elixir standard library functions.iex> Plausible.Cldr.Number.Transliterate.transliterate("123556")
"123556"
-iex> Plausible.Cldr.Number.Transliterate.transliterate("123,556.000", "fr", :default)
+iex> Plausible.Cldr.Number.Transliterate.transliterate("123,556.000", "fr", :default)
"123 556,000"
-iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", :default)
+iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", :default)
"123556"
-iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", "thai")
+iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", "thai")
"๑๒๓๕๕๖"
-iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", :native)
+iex> Plausible.Cldr.Number.Transliterate.transliterate("123556", "th", :native)
"๑๒๓๕๕๖"
-iex> Plausible.Cldr.Number.Transliterate.transliterate("Some number is: 123556", "th", "thai")
+iex> Plausible.Cldr.Number.Transliterate.transliterate("Some number is: 123556", "th", "thai")
"Some number is: ๑๒๓๕๕๖"
-iex> Plausible.Cldr.Number.parse("+1.000,34", locale: "de")
-{:ok, 1000.34}
+
+iex> Plausible.Cldr.Number.parse("+1.000,34", locale: "de", number: :integer)
+{:error,
+ {Cldr.Number.ParseError,
+ "The string \"+1.000,34\" could not be parsed as a number"}}iex> Plausible.Cldr.Number.parse("+1.000,34", locale: "de")
+{:ok, 1000.34}
-iex> Plausible.Cldr.Number.parse("-1_000_000.34")
-{:ok, -1000000.34}
+iex> Plausible.Cldr.Number.parse("-1_000_000.34")
+{:ok, -1000000.34}
-iex> Plausible.Cldr.Number.parse("1.000", locale: "de", number: :integer)
-{:ok, 1000}
+iex> Plausible.Cldr.Number.parse("1.000", locale: "de", number: :integer)
+{:ok, 1000}
-iex> Plausible.Cldr.Number.parse("+1.000,34", locale: "de", number: :integer)
-{:error,
- {Cldr.Number.ParseError,
- "The string \"+1.000,34\" could not be parsed as a number"}}
-iex> Plausible.Cldr.Number.scan("100 US dollars")
+
+iex> Plausible.Cldr.Number.scan("100 dollars des États-Unis")
+...> |> Plausible.Cldr.Number.resolve_currencies(locale: "fr")
+[100, :USD]iex> Plausible.Cldr.Number.scan("100 US dollars")
...> |> Plausible.Cldr.Number.resolve_currencies
-[100, :USD]
+[100, :USD]
-iex> Plausible.Cldr.Number.scan("100 eurosports")
-...> |> Plausible.Cldr.Number.resolve_currencies(fuzzy: 0.75)
-[100, :EUR]
+iex> Plausible.Cldr.Number.scan("100 eurosports")
+...> |> Plausible.Cldr.Number.resolve_currencies(fuzzy: 0.75)
+[100, :EUR]
-iex> Plausible.Cldr.Number.scan("100 dollars des États-Unis")
-...> |> Plausible.Cldr.Number.resolve_currencies(locale: "fr")
-[100, :USD]
iex> Plausible.Cldr.Number.resolve_currency("US dollars")
-[:USD]
+
+iex> Plausible.Cldr.Number.resolve_currency("not a known currency", locale: "fr")
+{:error,
+ {Cldr.UnknownCurrencyError,
+ "The currency \"not a known currency\" is unknown or not supported"}}iex> Plausible.Cldr.Number.resolve_currency("US dollars")
+[:USD]
-iex> Plausible.Cldr.Number.resolve_currency("100 eurosports", fuzzy: 0.75)
-[:EUR]
+iex> Plausible.Cldr.Number.resolve_currency("100 eurosports", fuzzy: 0.75)
+[:EUR]
-iex> Plausible.Cldr.Number.resolve_currency("dollars des États-Unis", locale: "fr")
-[:USD]
+iex> Plausible.Cldr.Number.resolve_currency("dollars des États-Unis", locale: "fr")
+[:USD]
-iex> Plausible.Cldr.Number.resolve_currency("not a known currency", locale: "fr")
-{:error,
- {Cldr.UnknownCurrencyError,
- "The currency \"not a known currency\" is unknown or not supported"}}
options[:backend].get_locale()
+[:percent, " of linguists ", :percent]
iex> Plausible.Cldr.Number.resolve_per "11%"
-["11", :percent]
+["11", :percent]
iex> Plausible.Cldr.Number.resolve_per "% of linguists"
-[:percent, " of linguists"]
+[:percent, " of linguists"]
iex> Plausible.Cldr.Number.resolve_per "% of linguists %"
-[:percent, " of linguists ", :percent]
options[:backend].get_locale()
Examples
-
+iex> Plausible.Cldr.Number.scan("100%")
-...> |> Plausible.Cldr.Number.resolve_pers()
-[100, :percent]
iex> Plausible.Cldr.Number.scan("100%")
+...> |> Plausible.Cldr.Number.resolve_pers()
+[100, :percent]
iex> Plausible.Cldr.Number.scan("£1_000_000.34")
-["£", 1000000.34]
+
+iex> Plausible.Cldr.Number.scan("The loss is -1.000 euros", locale: "de", number: :integer)
+["The loss is ", -1000, " euros"]
iex> Plausible.Cldr.Number.scan("£1_000_000.34")
+["£", 1000000.34]
-iex> Plausible.Cldr.Number.scan("I want £1_000_000 dollars")
-["I want £", 1000000, " dollars"]
+iex> Plausible.Cldr.Number.scan("I want £1_000_000 dollars")
+["I want £", 1000000, " dollars"]
-iex> Plausible.Cldr.Number.scan("The prize is 23")
-["The prize is ", 23]
+iex> Plausible.Cldr.Number.scan("The prize is 23")
+["The prize is ", 23]
-iex> Plausible.Cldr.Number.scan("The lottery number is 23 for the next draw")
-["The lottery number is ", 23, " for the next draw"]
+iex> Plausible.Cldr.Number.scan("The lottery number is 23 for the next draw")
+["The lottery number is ", 23, " for the next draw"]
-iex> Plausible.Cldr.Number.scan("The loss is -1.000 euros", locale: "de", number: :integer)
-["The loss is ", -1000, " euros"]
iex> Plausible.Cldr.Number.to_approx_string 1234
-{:ok, "~1,234"}
+{:ok, "~1,234"}
iex> Plausible.Cldr.Number.to_at_least_string 1234
-{:ok, "1,234+"}
+{:ok, "1,234+"}
iex> Plausible.Cldr.Number.to_at_most_string 1234
-{:ok, "≤1,234"}
+{:ok, "≤1,234"}
+{:ok, "1,234–5,678"}
iex> Plausible.Cldr.Number.to_range_string 1234..5678
-{:ok, "1,234–5,678"}
iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn
+applied to the symbol than the number. For example:
iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn
...> string, :currency_symbol -> "<span class=\"symbol\">" <> string <> "</span>"
...> string, :number -> "<span class=\"number\">" <> string <> "</span>"
...> string, :currency_space -> "<span>" <> string <> "</span>"
...> string, _other -> string
-...> end)
-{:ok, "<span class=\"symbol\">$</span><span class=\"number\">100.00</span>"}
Phoenix.HTML.Tag.content_tag/3
+Phoenix.HTML.Tag.content_tag/3
function if wrapping HTML tags since these will ensure HTML entities are
-correctly encoded. For example:iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn
-...> string, :currency_symbol -> Phoenix.HTML.Tag.content_tag(:span, string, class: "symbol")
-...> string, :number -> Phoenix.HTML.Tag.content_tag(:span, string, class: "number")
-...> string, :currency_space -> Phoenix.HTML.Tag.content_tag(:span, string)
+correctly encoded. For example:
iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn
+...> string, :currency_symbol -> Phoenix.HTML.Tag.content_tag(:span, string, class: "symbol")
+...> string, :number -> Phoenix.HTML.Tag.content_tag(:span, string, class: "number")
+...> string, :currency_space -> Phoenix.HTML.Tag.content_tag(:span, string)
...> string, _other -> string
-...> end)
-{:ok, "<span class=\"symbol\">$</span><span class=\"number\">100.00</span>"}
iex> Plausible.Cldr.Number.to_string 12345
-{:ok, "12,345"}
+{:ok, "12,345"}
iex> Plausible.Cldr.Number.to_string 12345, locale: "fr"
-{:ok, "12 345"}
+{:ok, "12 345"}
iex> Plausible.Cldr.Number.to_string 1345.32, currency: :EUR, locale: "es", minimum_grouping_digits: 1
-{:ok, "1.345,32 €"}
+{:ok, "1.345,32 €"}
iex> Plausible.Cldr.Number.to_string 1345.32, currency: :EUR, locale: "es"
-{:ok, "1345,32 €"}
+{:ok, "1345,32 €"}
iex> Plausible.Cldr.Number.to_string 12345, locale: "fr", currency: "USD"
-{:ok, "12 345,00 $US"}
+{:ok, "12 345,00 $US"}
iex> Plausible.Cldr.Number.to_string 12345, format: "#E0"
-{:ok, "1.2345E4"}
+{:ok, "1.2345E4"}
iex> Plausible.Cldr.Number.to_string 12345, format: :accounting, currency: "THB"
-{:ok, "THB 12,345.00"}
+{:ok, "THB 12,345.00"}
iex> Plausible.Cldr.Number.to_string -12345, format: :accounting, currency: "THB"
-{:ok, "(THB 12,345.00)"}
+{:ok, "(THB 12,345.00)"}
iex> Plausible.Cldr.Number.to_string 12345, format: :accounting, currency: "THB",
...> locale: "th"
-{:ok, "฿12,345.00"}
+{:ok, "฿12,345.00"}
iex> Plausible.Cldr.Number.to_string 12345, format: :accounting, currency: "THB",
...> locale: "th", number_system: :native
-{:ok, "฿๑๒,๓๔๕.๐๐"}
+{:ok, "฿๑๒,๓๔๕.๐๐"}
iex> Plausible.Cldr.Number.to_string 1244.30, format: :long
-{:ok, "1 thousand"}
+{:ok, "1 thousand"}
iex> Plausible.Cldr.Number.to_string 1244.30, format: :long, currency: "USD"
-{:ok, "1,244 US dollars"}
+{:ok, "1,244 US dollars"}
iex> Plausible.Cldr.Number.to_string 1244.30, format: :short
-{:ok, "1K"}
+{:ok, "1K"}
iex> Plausible.Cldr.Number.to_string 1244.30, format: :short, currency: "EUR"
-{:ok, "€1K"}
+{:ok, "€1K"}
iex> Plausible.Cldr.Number.to_string 1234, format: :spellout
-{:ok, "one thousand two hundred thirty-four"}
+{:ok, "one thousand two hundred thirty-four"}
iex> Plausible.Cldr.Number.to_string 1234, format: :spellout_verbose
-{:ok, "one thousand two hundred and thirty-four"}
+{:ok, "one thousand two hundred and thirty-four"}
iex> Plausible.Cldr.Number.to_string 1989, format: :spellout_year
-{:ok, "nineteen eighty-nine"}
+{:ok, "nineteen eighty-nine"}
iex> Plausible.Cldr.Number.to_string 123, format: :ordinal
-{:ok, "123rd"}
+{:ok, "123rd"}
iex> Plausible.Cldr.Number.to_string 123, format: :roman
-{:ok, "CXXIII"}
+{:ok, "CXXIII"}
iex> Plausible.Cldr.Number.to_string 123, locale: "th-u-nu-thai"
-{:ok, "๑๒๓"}
+{:ok, "๑๒๓"}
Errors
{:error, reason}
will be returned if an error is detected.
-The two most likely causes of an error return are: iex> Plausible.Cldr.Number.to_string(12345, format: "0#")
- {:error, {Cldr.FormatCompileError,
- "Decimal format compiler: syntax error before: \"#\""}}
locale
and
+The two most likely causes of an error return are: iex> Plausible.Cldr.Number.to_string(12345, format: "0#")
+ {:error, {Cldr.FormatCompileError,
+ "Decimal format compiler: syntax error before: \"#\""}}
locale
and
number_system
. This happens typically when the number system is
:algorithmic
rather than the more common :numeric
. In this case the error
-return looks like:
+return looks like: iex> Plausible.Cldr.Number.to_string(1234, locale: "he", number_system: "hebr")
- {:error, {Cldr.UnknownFormatError,
- "The locale :he with number system :hebr does not define a format :standard"}}
iex> Plausible.Cldr.Number.to_string(1234, locale: "he", number_system: "hebr")
+ {:error, {Cldr.UnknownFormatError,
+ "The locale :he with number system :hebr does not define a format :standard"}}
Cldr.Number.to_string/2
function.iex> Plausible.Cldr.Rbnf.NumberSystem.rule_sets(:und)
-...> |> Enum.sort()
-[
+defined in the Unicode CLDR data repository. Available rules are identified by:
iex> Plausible.Cldr.Rbnf.NumberSystem.rule_sets(:und)
+...> |> Enum.sort()
+[
:armenian_lower,
:armenian_upper,
:cyrillic_lower,
@@ -132,9 +132,9 @@ defined in the Unicode CLDR data repository. Available rules are identified by:
:roman_upper,
:tamil,
:zz_default
-]
iex> Plausible.Cldr.Rbnf.NumberSystem.roman_upper(123, :und)
-"CXXIII"
+]iex> Plausible.Cldr.Number.to_string(123, format: :roman)
-{:ok, "CXXIII"}
iex> Plausible.Cldr.Rbnf.NumberSystem.roman_upper(123, :und)
+"CXXIII"
iex> Plausible.Cldr.Number.to_string(123, format: :roman)
+{:ok, "CXXIII"}
Cldr.Number.to_string/2
function.iex> Plausible.Cldr.Rbnf.Ordinal.rule_sets(:en)
-[:digits_ordinal]
+defined in the Unicode CLDR data repository. Available rules are identified by:
iex> Plausible.Cldr.Rbnf.Ordinal.rule_sets(:en)
+[:digits_ordinal]
-iex> Plausible.Cldr.Rbnf.Ordinal.rule_sets("fr")
-...> |> Enum.sort()
-[
+iex> Plausible.Cldr.Rbnf.Ordinal.rule_sets("fr")
+...> |> Enum.sort()
+[
:digits_ordinal,
:digits_ordinal_feminine,
:digits_ordinal_feminine_plural,
:digits_ordinal_masculine,
:digits_ordinal_masculine_plural
-]
iex> Plausible.Cldr.Rbnf.Ordinal.digits_ordinal(123, :en)
-"123rd"
+]iex> Plausible.Cldr.Number.to_string(123, format: :ordinal)
-{:ok, "123rd"}
iex> Plausible.Cldr.Rbnf.Ordinal.digits_ordinal(123, :en)
+"123rd"
iex> Plausible.Cldr.Number.to_string(123, format: :ordinal)
+{:ok, "123rd"}
Cldr.Number.to_string/2
function.iex> Plausible.Cldr.Rbnf.Spellout.rule_sets("en")
-...> |> Enum.sort()
-[
+defined in the Unicode CLDR data repository. Available rules are identified by:
iex> Plausible.Cldr.Rbnf.Spellout.rule_sets("en")
+...> |> Enum.sort()
+[
:spellout_cardinal,
:spellout_cardinal_verbose,
:spellout_numbering,
@@ -126,9 +126,9 @@ defined in the Unicode CLDR data repository. Available rules are identified by:
:spellout_numbering_year,
:spellout_ordinal,
:spellout_ordinal_verbose
-]
iex> Plausible.Cldr.Rbnf.Spellout.spellout_ordinal(123, "en")
-"one hundred twenty-third"
+]iex> Plausible.Cldr.Number.to_string(123, format: :spellout)
-{:ok, "one hundred twenty-three"}
iex> Plausible.Cldr.Rbnf.Spellout.spellout_ordinal(123, "en")
+"one hundred twenty-third"
iex> Plausible.Cldr.Number.to_string(123, format: :spellout)
+{:ok, "one hundred twenty-three"}
iex> Plausible.Cldr.default_locale()
-%Cldr.LanguageTag{
+
+ transform: %{},
+ language_variants: []
+}iex> Plausible.Cldr.default_locale()
+%Cldr.LanguageTag{
backend: Plausible.Cldr,
canonical_locale_name: "en-001",
cldr_locale_name: :"en-001",
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: "en",
language: "en",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :en,
requested_locale_name: "en-001",
script: :Latn,
territory: :"001",
- transform: %{},
- language_variants: []
-}
iex> Plausible.Cldr.default_territory()
+
iex> Plausible.Cldr.default_territory()
:"001"
@@ -675,23 +675,23 @@ take an optional locale parameter for which a locale is not supplied.iex> Plausible.Cldr.ellipsis "And furthermore"
"And furthermore…"
-iex> Plausible.Cldr.ellipsis ["And furthermore", "there is much to be done"], locale: :ja
+iex> Plausible.Cldr.ellipsis ["And furthermore", "there is much to be done"], locale: :ja
"And furthermore…there is much to be done"
iex> Plausible.Cldr.ellipsis "And furthermore", format: :word
"And furthermore …"
-iex> Plausible.Cldr.ellipsis ["And furthermore", "there is much to be done"], locale: :ja, format: :word
+iex> Plausible.Cldr.ellipsis ["And furthermore", "there is much to be done"], locale: :ja, format: :word
"And furthermore … there is much to be done"
-iex> Plausible.Cldr.put_locale("pl")
+
+ transform: %{},
+ language_variants: []
+ }iex> Plausible.Cldr.put_locale("pl")
iex> Plausible.Cldr.get_locale
-%Cldr.LanguageTag{
+%Cldr.LanguageTag{
backend: Elixir.Plausible.Cldr,
canonical_locale_name: "pl",
cldr_locale_name: :pl,
- extensions: %{},
+ extensions: %{},
language: "pl",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :pl,
territory: :PL,
requested_locale_name: "pl",
script: :Latn,
- transform: %{},
- language_variants: []
- }
iex> Plausible.Cldr.known_gettext_locale_name?("en")
+
iex> Plausible.Cldr.known_gettext_locale_name?("en")
true
-iex> Plausible.Cldr.known_gettext_locale_name?("!!")
+iex> Plausible.Cldr.known_gettext_locale_name?("!!")
false
iex> Plausible.Cldr.known_locale_name?(:en)
+
@@ -1004,7 +1004,7 @@ in this module or in iex> Plausible.Cldr.known_locale_name?(:en)
true
-iex> Plausible.Cldr.known_locale_name?(:"!!")
+iex> Plausible.Cldr.known_locale_name?(:"!!")
false
+[:default, :finance, :native, :traditional]
iex> Plausible.Cldr.known_number_system_types
-[:default, :finance, :native, :traditional]
iex> Plausible.Cldr.known_rbnf_locale_name?(:en)
+
iex> Plausible.Cldr.known_rbnf_locale_name?(:en)
true
-iex> Plausible.Cldr.known_rbnf_locale_name?(:"!!")
+iex> Plausible.Cldr.known_rbnf_locale_name?(:"!!")
false
Examples
-iex> Plausible.Cldr.put_locale("en")
-{:ok,
- %Cldr.LanguageTag{
+
+iex> Plausible.Cldr.put_locale("invalid-locale!")
+{:error, {Cldr.LanguageTag.ParseError,
+ "Expected a BCP47 language tag. Could not parse the remaining \"!\" starting at position 15"}}iex> Plausible.Cldr.put_locale("en")
+{:ok,
+ %Cldr.LanguageTag{
backend: Plausible.Cldr,
canonical_locale_name: "en",
cldr_locale_name: :en,
- language_subtags: [],
- extensions: %{},
+ language_subtags: [],
+ extensions: %{},
gettext_locale_name: "en",
language: "en",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :en,
requested_locale_name: "en",
script: :Latn,
territory: :US,
- transform: %{},
- language_variants: []
- }}
+ transform: %{},
+ language_variants: []
+ }}
-iex> Plausible.Cldr.put_locale("invalid-locale!")
-{:error, {Cldr.LanguageTag.ParseError,
- "Expected a BCP47 language tag. Could not parse the remaining \"!\" starting at position 15"}}
iex> Plausible.Cldr.validate_locale(:en)
-{:ok,
-%Cldr.LanguageTag{
+
+iex> Plausible.Cldr.validate_locale("zzz")
+{:error, {Cldr.InvalidLanguageError, "The language \"zzz\" is invalid"}}
iex> Plausible.Cldr.validate_locale(:en)
+{:ok,
+%Cldr.LanguageTag{
backend: Plausible.Cldr,
canonical_locale_name: "en",
cldr_locale_name: :en,
- extensions: %{},
+ extensions: %{},
gettext_locale_name: "en",
language: "en",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :en,
requested_locale_name: "en",
script: :Latn,
territory: :US,
- transform: %{},
- language_variants: []
-}}
+ transform: %{},
+ language_variants: []
+}}
-iex> Plausible.Cldr.validate_locale Plausible.Cldr.default_locale()
-{:ok,
-%Cldr.LanguageTag{
+iex> Plausible.Cldr.validate_locale Plausible.Cldr.default_locale()
+{:ok,
+%Cldr.LanguageTag{
backend: Plausible.Cldr,
canonical_locale_name: "en-001",
cldr_locale_name: :"en-001",
- extensions: %{},
+ extensions: %{},
gettext_locale_name: "en",
language: "en",
- locale: %{},
- private_use: [],
+ locale: %{},
+ private_use: [],
rbnf_locale_name: :en,
requested_locale_name: "en-001",
script: :Latn,
territory: :"001",
- transform: %{},
- language_variants: []
-}}
+ transform: %{},
+ language_variants: []
+}}
-iex> Plausible.Cldr.validate_locale("zzz")
-{:error, {Cldr.InvalidLanguageError, "The language \"zzz\" is invalid"}}
iex> Plausible.Cldr.validate_number_system_type :default
-{:ok, :default}
+{:ok, :default}
iex> Plausible.Cldr.validate_number_system_type :traditional
-{:ok, :traditional}
+{:ok, :traditional}
iex> Plausible.Cldr.validate_number_system_type :latn
-{
+{
:error,
- {Cldr.UnknownNumberSystemTypeError, "The number system type :latn is unknown"}
-}
+ {Cldr.UnknownNumberSystemTypeError, "The number system type :latn is unknown"}
+}
iex> Plausible.Cldr.validate_number_system_type "bork"
-{
+{
:error,
- {Cldr.UnknownNumberSystemTypeError, "The number system type \"bork\" is invalid"}
-}
+ {Cldr.UnknownNumberSystemTypeError, "The number system type \"bork\" is invalid"}
+}
insert_all/2
but with the following differences:Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
+
insert_all/2
but with the following differences:
+{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
-defmodule Demo do
+defmodule Demo do
use Ecto.Schema
@primary_key false
- schema "ecto_ch_demo" do
+ schema "ecto_ch_demo" do
field :a, Ch, type: "UInt64"
field :b, :string
- end
-end
+ end
+end
-rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
-{100_000, nil} = Repo.insert_stream(Demo, rows)
+rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
+{100_000, nil} = Repo.insert_stream(Demo, rows)
# schemaless
-{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
iex> database_type()
-"DBIP-City-Lite"
iex> database_type()
+
iex> database_type()
+"DBIP-City-Lite"
iex> database_type()
"GeoLite2-City"
-iex> load_db(path: "/etc/plausible/dbip-city.mmdb")
-:ok
iex> load_db(license_key: "LNpsJCCKPis6XvBP", edition: "GeoLite2-City", async: true)
+
iex> load_db(path: "/etc/plausible/dbip-city.mmdb")
+:ok
@@ -302,21 +302,21 @@ asynchronously.iex> load_db(license_key: "LNpsJCCKPis6XvBP", edition: "GeoLite2-City", async: true)
:ok
-
diff --git a/Plausible.Goal.html b/Plausible.Goal.html
index 5c37e195d..20d547277 100644
--- a/Plausible.Goal.html
+++ b/Plausible.Goal.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Goals.html b/Plausible.Goals.html
index 4cb9933ac..04bedbd78 100644
--- a/Plausible.Goals.html
+++ b/Plausible.Goals.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Google.Api.Mock.html b/Plausible.Google.Api.Mock.html
index 2e2d59d48..c8c28dcfe 100644
--- a/Plausible.Google.Api.Mock.html
+++ b/Plausible.Google.Api.Mock.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Google.Api.html b/Plausible.Google.Api.html
index 2ea91aaf5..716ecf1c0 100644
--- a/Plausible.Google.Api.html
+++ b/Plausible.Google.Api.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Google.Buffer.html b/Plausible.Google.Buffer.html
index a021a77ac..b4a4bf30b 100644
--- a/Plausible.Google.Buffer.html
+++ b/Plausible.Google.Buffer.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Google.HTTP.html b/Plausible.Google.HTTP.html
index e0b3cd2ec..4aac7e5b8 100644
--- a/Plausible.Google.HTTP.html
+++ b/Plausible.Google.HTTP.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Google.ReportRequest.html b/Plausible.Google.ReportRequest.html
index f97cb32a8..1ebd9e340 100644
--- a/Plausible.Google.ReportRequest.html
+++ b/Plausible.Google.ReportRequest.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.HTTPClient.Interface.html b/Plausible.HTTPClient.Interface.html
index b63fc0867..eb4aede36 100644
--- a/Plausible.HTTPClient.Interface.html
+++ b/Plausible.HTTPClient.Interface.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.HTTPClient.Non200Error.html b/Plausible.HTTPClient.Non200Error.html
index c55eea830..15d8700c2 100644
--- a/Plausible.HTTPClient.Non200Error.html
+++ b/Plausible.HTTPClient.Non200Error.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.HTTPClient.html b/Plausible.HTTPClient.html
index b51a5980a..fb6ffcdd5 100644
--- a/Plausible.HTTPClient.html
+++ b/Plausible.HTTPClient.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.ImportDeletionRepo.html b/Plausible.ImportDeletionRepo.html
index 698e40916..59663f41d 100644
--- a/Plausible.ImportDeletionRepo.html
+++ b/Plausible.ImportDeletionRepo.html
@@ -13,7 +13,7 @@
-
+
@@ -1114,23 +1114,23 @@ pool to disconnect within the given interval.iex> lookup("8.7.6.5")
-%{
- "city" => %{
+
+ }
+ }
+ ]
+}iex> lookup("8.7.6.5")
+%{
+ "city" => %{
"geoname_id" => 5349755,
- "names" => %{
+ "names" => %{
"de" => "Fontana",
"en" => "Fontana",
"ja" => "フォンタナ",
"ru" => "Фонтана"
- }
- },
- "continent" => %{
+ }
+ },
+ "continent" => %{
"code" => "NA",
"geoname_id" => 6255149,
- "names" => %{
+ "names" => %{
"de" => "Nordamerika",
"en" => "North America",
"es" => "Norteamérica",
@@ -325,12 +325,12 @@ asynchronously.
"pt-BR" => "América do Norte",
"ru" => "Северная Америка",
"zh-CN" => "北美洲"
- }
- },
- "country" => %{
+ }
+ },
+ "country" => %{
"geoname_id" => 6252001,
"iso_code" => "US",
- "names" => %{
+ "names" => %{
"de" => "Vereinigte Staaten",
"en" => "United States",
"es" => "Estados Unidos",
@@ -339,20 +339,20 @@ asynchronously.
"pt-BR" => "EUA",
"ru" => "США",
"zh-CN" => "美国"
- }
- },
- "location" => %{
+ }
+ },
+ "location" => %{
"accuracy_radius" => 50,
"latitude" => 34.1211,
"longitude" => -117.4362,
"metro_code" => 803,
"time_zone" => "America/Los_Angeles"
- },
- "postal" => %{"code" => "92336"},
- "registered_country" => %{
+ },
+ "postal" => %{"code" => "92336"},
+ "registered_country" => %{
"geoname_id" => 6252001,
"iso_code" => "US",
- "names" => %{
+ "names" => %{
"de" => "Vereinigte Staaten",
"en" => "United States",
"es" => "Estados Unidos",
@@ -361,13 +361,13 @@ asynchronously.
"pt-BR" => "EUA",
"ru" => "США",
"zh-CN" => "美国"
- }
- },
- "subdivisions" => [
- %{
+ }
+ },
+ "subdivisions" => [
+ %{
"geoname_id" => 5332921,
"iso_code" => "CA",
- "names" => %{
+ "names" => %{
"de" => "Kalifornien",
"en" => "California",
"es" => "California",
@@ -376,10 +376,10 @@ asynchronously.
"pt-BR" => "Califórnia",
"ru" => "Калифорния",
"zh-CN" => "加州"
- }
- }
- ]
-}
insert_all/2
but with the following differences:Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
+
insert_all/2
but with the following differences:
+{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
-defmodule Demo do
+defmodule Demo do
use Ecto.Schema
@primary_key false
- schema "ecto_ch_demo" do
+ schema "ecto_ch_demo" do
field :a, Ch, type: "UInt64"
field :b, :string
- end
-end
+ end
+end
-rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
-{100_000, nil} = Repo.insert_stream(Demo, rows)
+rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
+{100_000, nil} = Repo.insert_stream(Demo, rows)
# schemaless
-{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
insert_all/2
but with the following differences:Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
+
insert_all/2
but with the following differences:
+{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])Repo.query!("create table ecto_ch_demo(a UInt64, b String) engine Null")
-defmodule Demo do
+defmodule Demo do
use Ecto.Schema
@primary_key false
- schema "ecto_ch_demo" do
+ schema "ecto_ch_demo" do
field :a, Ch, type: "UInt64"
field :b, :string
- end
-end
+ end
+end
-rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
-{100_000, nil} = Repo.insert_stream(Demo, rows)
+rows = Stream.map(1..100_000, fn i -> %{a: i, b: to_string(i)} end)
+{100_000, nil} = Repo.insert_stream(Demo, rows)
# schemaless
-{100_000, nil} = Repo.insert_stream("ecto_ch_demo", rows, types: [a: Ch.Types.u64(), b: :string])
create(user, params)
-
+
View Source
@@ -373,7 +373,7 @@ Functions
create_shared_link(site, name, password \\ nil)
-
+
View Source
@@ -441,7 +441,7 @@ Functions
get_for_user(user_id, domain, roles \\ [:owner, :admin, :viewer])
-
+
View Source
@@ -465,7 +465,7 @@ Functions
get_for_user!(user_id, domain, roles \\ [:owner, :admin, :viewer])
-
+
View Source
@@ -487,7 +487,7 @@ Functions
has_admin_access?(user_id, site)
-
+
View Source
@@ -509,7 +509,7 @@ Functions
has_goals?(site)
-
+
View Source
@@ -531,7 +531,7 @@ Functions
has_stats?(site)
-
+
View Source
@@ -553,7 +553,7 @@ Functions
is_member?(user_id, site)
-
+
View Source
@@ -605,7 +605,7 @@ Functions
locked?(site)
-
+
View Source
@@ -627,7 +627,7 @@ Functions
owned_site_ids(user)
-
+
View Source
@@ -649,7 +649,7 @@ Functions
owned_sites_count(user)
-
+
View Source
@@ -671,7 +671,7 @@ Functions
owned_sites_domains(user)
-
+
View Source
@@ -693,7 +693,7 @@ Functions
role(user_id, site)
-
+
View Source
@@ -715,7 +715,7 @@ Functions
shared_link_url(site, link)
-
+
View Source
@@ -737,7 +737,7 @@ Functions
stats_start_date(site)
-
+
View Source
diff --git a/Plausible.Stats.Aggregate.html b/Plausible.Stats.Aggregate.html
index 51b661c02..ec254fa0e 100644
--- a/Plausible.Stats.Aggregate.html
+++ b/Plausible.Stats.Aggregate.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Base.html b/Plausible.Stats.Base.html
index 11d5db349..143b56c80 100644
--- a/Plausible.Stats.Base.html
+++ b/Plausible.Stats.Base.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Breakdown.html b/Plausible.Stats.Breakdown.html
index b664572ae..1a45f8802 100644
--- a/Plausible.Stats.Breakdown.html
+++ b/Plausible.Stats.Breakdown.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Clickhouse.html b/Plausible.Stats.Clickhouse.html
index 78ca8a85f..3db091c9f 100644
--- a/Plausible.Stats.Clickhouse.html
+++ b/Plausible.Stats.Clickhouse.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Compare.html b/Plausible.Stats.Compare.html
index 3f38cdbcb..3a0a3fe91 100644
--- a/Plausible.Stats.Compare.html
+++ b/Plausible.Stats.Compare.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Comparisons.html b/Plausible.Stats.Comparisons.html
index c4d93b7a1..f239aae4c 100644
--- a/Plausible.Stats.Comparisons.html
+++ b/Plausible.Stats.Comparisons.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.CurrentVisitors.html b/Plausible.Stats.CurrentVisitors.html
index 707c7abda..d0a51f307 100644
--- a/Plausible.Stats.CurrentVisitors.html
+++ b/Plausible.Stats.CurrentVisitors.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.CustomProps.html b/Plausible.Stats.CustomProps.html
index ef861d18e..26f14bb59 100644
--- a/Plausible.Stats.CustomProps.html
+++ b/Plausible.Stats.CustomProps.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.FilterParser.html b/Plausible.Stats.FilterParser.html
index b01d54440..8a1766750 100644
--- a/Plausible.Stats.FilterParser.html
+++ b/Plausible.Stats.FilterParser.html
@@ -13,7 +13,7 @@
-
+
@@ -178,14 +178,14 @@ Functions
Examples:
-
diff --git a/Plausible.Stats.FilterSuggestions.html b/Plausible.Stats.FilterSuggestions.html
index 46f12189f..9e51ebc2e 100644
--- a/Plausible.Stats.FilterSuggestions.html
+++ b/Plausible.Stats.FilterSuggestions.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Filters.html b/Plausible.Stats.Filters.html
index 42ca20531..c3439197f 100644
--- a/Plausible.Stats.Filters.html
+++ b/Plausible.Stats.Filters.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Fragments.html b/Plausible.Stats.Fragments.html
index b83a67654..312845104 100644
--- a/Plausible.Stats.Fragments.html
+++ b/Plausible.Stats.Fragments.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Funnel.html b/Plausible.Stats.Funnel.html
index eb6932a27..cfd74a23b 100644
--- a/Plausible.Stats.Funnel.html
+++ b/Plausible.Stats.Funnel.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Imported.html b/Plausible.Stats.Imported.html
index 88c1a757c..54ff3fe96 100644
--- a/Plausible.Stats.Imported.html
+++ b/Plausible.Stats.Imported.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Interval.html b/Plausible.Stats.Interval.html
index 7eb76c3d3..d0748896a 100644
--- a/Plausible.Stats.Interval.html
+++ b/Plausible.Stats.Interval.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Props.html b/Plausible.Stats.Props.html
index f8211d4c1..9faec3b7f 100644
--- a/Plausible.Stats.Props.html
+++ b/Plausible.Stats.Props.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Query.html b/Plausible.Stats.Query.html
index 7a92e4f13..fe29141a7 100644
--- a/Plausible.Stats.Query.html
+++ b/Plausible.Stats.Query.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Timeseries.html b/Plausible.Stats.Timeseries.html
index a058d79f1..4ebf2be84 100644
--- a/Plausible.Stats.Timeseries.html
+++ b/Plausible.Stats.Timeseries.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.Util.html b/Plausible.Stats.Util.html
index 8baa002e0..65866624b 100644
--- a/Plausible.Stats.Util.html
+++ b/Plausible.Stats.Util.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Stats.html b/Plausible.Stats.html
index 15f172f6a..1b5bfb3fc 100644
--- a/Plausible.Stats.html
+++ b/Plausible.Stats.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Test.Support.HTML.html b/Plausible.Test.Support.HTML.html
index b183e56ad..6c11b9839 100644
--- a/Plausible.Test.Support.HTML.html
+++ b/Plausible.Test.Support.HTML.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Test.Support.HTTPMocker.html b/Plausible.Test.Support.HTTPMocker.html
index 4627394c4..7fb3f9d71 100644
--- a/Plausible.Test.Support.HTTPMocker.html
+++ b/Plausible.Test.Support.HTTPMocker.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.TestUtils.html b/Plausible.TestUtils.html
index 948c2f75e..65ce540fc 100644
--- a/Plausible.TestUtils.html
+++ b/Plausible.TestUtils.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Themes.html b/Plausible.Themes.html
index 6c0e8d419..19fc3f19e 100644
--- a/Plausible.Themes.html
+++ b/Plausible.Themes.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Timezones.html b/Plausible.Timezones.html
index 5006d9194..6e05f529f 100644
--- a/Plausible.Timezones.html
+++ b/Plausible.Timezones.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Users.html b/Plausible.Users.html
index a584255d6..ea9b4a16a 100644
--- a/Plausible.Users.html
+++ b/Plausible.Users.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Workers.CheckUsage.html b/Plausible.Workers.CheckUsage.html
index f975e7c0d..845113754 100644
--- a/Plausible.Workers.CheckUsage.html
+++ b/Plausible.Workers.CheckUsage.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Workers.CleanInvitations.html b/Plausible.Workers.CleanInvitations.html
index 6a1ef2388..74603d208 100644
--- a/Plausible.Workers.CleanInvitations.html
+++ b/Plausible.Workers.CleanInvitations.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Workers.ExpireDomainChangeTransitions.html b/Plausible.Workers.ExpireDomainChangeTransitions.html
index 860199028..70702f0a9 100644
--- a/Plausible.Workers.ExpireDomainChangeTransitions.html
+++ b/Plausible.Workers.ExpireDomainChangeTransitions.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Workers.ImportGoogleAnalytics.html b/Plausible.Workers.ImportGoogleAnalytics.html
index 563a015e3..34d2848e9 100644
--- a/Plausible.Workers.ImportGoogleAnalytics.html
+++ b/Plausible.Workers.ImportGoogleAnalytics.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Workers.LockSites.html b/Plausible.Workers.LockSites.html
index 6d92f492c..efb07d844 100644
--- a/Plausible.Workers.LockSites.html
+++ b/Plausible.Workers.LockSites.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Workers.NotifyAnnualRenewal.html b/Plausible.Workers.NotifyAnnualRenewal.html
index a19af12a3..f0e49aeb3 100644
--- a/Plausible.Workers.NotifyAnnualRenewal.html
+++ b/Plausible.Workers.NotifyAnnualRenewal.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Workers.RotateSalts.html b/Plausible.Workers.RotateSalts.html
index 875f8164a..35ae0e8bc 100644
--- a/Plausible.Workers.RotateSalts.html
+++ b/Plausible.Workers.RotateSalts.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Workers.ScheduleEmailReports.html b/Plausible.Workers.ScheduleEmailReports.html
index e198dd612..38c706ecf 100644
--- a/Plausible.Workers.ScheduleEmailReports.html
+++ b/Plausible.Workers.ScheduleEmailReports.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Workers.SendCheckStatsEmails.html b/Plausible.Workers.SendCheckStatsEmails.html
index a9fe63cf6..90ff7ea30 100644
--- a/Plausible.Workers.SendCheckStatsEmails.html
+++ b/Plausible.Workers.SendCheckStatsEmails.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Workers.SendEmailReport.html b/Plausible.Workers.SendEmailReport.html
index 5984b0728..c4442cfc4 100644
--- a/Plausible.Workers.SendEmailReport.html
+++ b/Plausible.Workers.SendEmailReport.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Workers.SendSiteSetupEmails.html b/Plausible.Workers.SendSiteSetupEmails.html
index c95d4d034..f7e309960 100644
--- a/Plausible.Workers.SendSiteSetupEmails.html
+++ b/Plausible.Workers.SendSiteSetupEmails.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Workers.SendTrialNotifications.html b/Plausible.Workers.SendTrialNotifications.html
index dca05983b..3e5752109 100644
--- a/Plausible.Workers.SendTrialNotifications.html
+++ b/Plausible.Workers.SendTrialNotifications.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.Workers.SpikeNotifier.html b/Plausible.Workers.SpikeNotifier.html
index fa9ff265a..bcd91eb8d 100644
--- a/Plausible.Workers.SpikeNotifier.html
+++ b/Plausible.Workers.SpikeNotifier.html
@@ -13,7 +13,7 @@
-
+
diff --git a/Plausible.epub b/Plausible.epub
index 0b3a9e468b31f00e1699edb97a495d79297adcd3..11a6a17c48bed8f852f775bdcd21c9b2b9030490 100644
GIT binary patch
delta 123883
zcmY(qbzD`=7ca~Sy1S%98l+3QyO9v3L%O97sYr)#DCq`iI7qj2cXx-hgmUpbzxTbL
z%RlS8*UYS0v)FrP#hj}fnz}n03=L%vm;mA5U!qk!h9EG}s#-1s@JwpA0h~ntC?N?3
z_CHGZvJ~SV9pfQ`w;%E5p`a#O+30h5?biex> FilterParser.parse_filters("{\"page\":\"/blog/**\"}")
-%{"page" => "/blog/**"}
+
+iex> FilterParser.parse_filters(nil)
+%{}iex> FilterParser.parse_filters("{\"page\":\"/blog/**\"}")
+%{"page" => "/blog/**"}
-iex> FilterParser.parse_filters("visit:browser!=Chrome")
-%{"visit:browser" => {:is_not, "Chrome"}}
+iex> FilterParser.parse_filters("visit:browser!=Chrome")
+%{"visit:browser" => {:is_not, "Chrome"}}
-iex> FilterParser.parse_filters(nil)
-%{}
61J+W2ylAgWU7CO70@oOshaHngOS^x-}<9?T!QUUed+v
z^7+#@5u5gt0ze7&*Cb7m0>A`Rtyo5FqWRUjNl>qA%j0E#hH=x?b0a#3Blo2Bl=IU9
zH_k`44qW#cdJa(>0&DE~(>Gng){
9e(H+c#g#mX?FK(Iss&rBzOj(diZ7W`||&+Mbs{@h&|Pz4S~wSB?fx
z)e5vQ=3z}0UZukdj*A@%XBN%e4}3lHlPQE7HzMawTQP_2MXCIPSUHy>4vkdM+^{pf&pN~%LK=bA
zHGayG&pHzZpzyb?kBdXxwZbx|YzNq&GpVvQszz1HGc1X)@OX3u%2ilFhl}l=%j;`m
z2O$C~DJ!j@7g{0O4?HD2nSFzq&o37LoLv0)xqVL&yKXE93-)zSj5mXC=c7Th8)aGW
z;i|mos(wG(7zF9Lh3B*tgMRK7#ZLg+ihiT!B4ua_%I$QM+V6h-`k6dtS=b9P%F!Gwpl0uJJKO*+A|-K5#QrRytOzu~uZV1ET
#NE
z9!s;Y!br@73#*~uloNxQ7k}r5F+)g)QvIyD0z|?{D?VCO4F2b
jluVZ{>xXLXqUr00#<9{?#Kny!j()4g$*L?iSc`&6w7pjeylO)vkIe
zdlUM)r6=@eAB&=G+vSJo&b{RAR-A5$X5pWyzGGNeX?7X}(C6^AYqOy2#z__WH&-yu
zQ@fYQ{>i|N8hJ~m4$5FnbG4qW0z~#eH?|a3Cx^)Ws30QStp!7J_J-!SEcCYK0+&rN
zjiWZ_FiXi*g|wq5@KrBYt`be;5Ig=dY?_15{?bGC^b_R|y*#o8Ac1yfSmH8xdg|Hy
zU}3$*1oRrs@={7!Vn
{QBsZ)oJx%-2d_