Template:ISO 4217/code/doc: Difference between revisions

From IDU Wiki
Jump to navigation Jump to search
en>DePiep
 
m (1 revision imported)
 
(No difference)

Latest revision as of 13:23, 19 March 2023

Utilising the alpha3 ISO 4217 code. For example, the code number can be derived from the code. Based on the ISO 4217 Standfard definition (per {{ISO 4217/cite}}, Template:As of).

There are 304 unique codes (ADP..ZWR). Codes are reused (as currency in history, in history with different end-date by country, in List Two funds, in entities) resulting in 452 currency definitions (data rows).

General[edit source]

|iso-code=
|format=
|is-obsolete=

Most parameters work by {{yesno}} principle: yes, 1, true, <anytext> and no, 0, false, <blank> are recognised as T/F.

See also Template:Slink
|format=-options can be comma-separated list: |format=option-none, ISO4217-cat, mono, brackets, (as announced per template)

Base: iso-code[edit source]

ISO 4217/code[edit source]

Returns valid ISO 4217 code or blank.

|iso-code=
Basic: |format=<blank> returns EITHER the code as exists OR <blank> (no tracking etc)
|format=option-none, ISO4217-cat
See Template:Slink

Other data (ref, comment) elsewhere. Data Template:As of, per source {{ISO 4217/cite}}

iso-code error (maintenance category)[edit source]

|format=ISO4217-cat will categorise articles with ISO-codes that do not exist in ISO. Sorted under C.
(When in Template space, a wikilink to the category will show: |iso-code=ZZZ ISOcat-C*)
See Template:Slink

option-none (code='None')[edit source]

|format=option-none will allow |iso-code=''None'', none, no (formatting is optional).
Internally, {{ISO 4217/code-none}} returns _NONE_ or <blank>.

When code "None" is not allowed |format=option-none, |iso-code=None input is considered unrecognised code (returns blank). Will be categorised from mainspace, sorted under N.

(In Template space: |iso-code=None ISOcat-C*)
See Template:Slink

Examples[edit source]

in plain is "None"? |format=option-none
option-none=<absent>
|format=ISO4217-cat number minor unit
|iso-code=USD USD USD USD (840) Template:Val
|iso-code=''None'' ISOcat-C*
ISOcat-C*
ISOcat-C*
|iso-code=ZZZ ISOcat-C* ISOcat-C*
|iso-code=<blank>

Derived value templates[edit source]

minor unit[edit source]

  • "Minor unit" in ISO 4217: number of decimals for minor unit used in currency trade. For example, USD has Minor unit=2, i.e. Template:Val (dollarcent unit).

Occurring values are: <blank>, N.A., 0, 2, 3, 4. So, incidentally, 1 (for Template:Val) is not present. Obsolete currency (historical, List Three): has no minor unit ("blank").

In enwiki: "<blank>", "N.A.", "0" all return blank, because "Template:Val" is not a subunit of "Template:Val".
|iso-code=, |is-obsolete=, |format=blank/default (0.001-form), exponent (N.A., <blank>, 0, 2, 3, 4)
Examples
<blank> AFA: →
N.A. XPD: →
0 KRW: →
1 (not present)
2 RUB: Template:ValTemplate:Val
3 OMR: Template:ValTemplate:Val
4 CLF: Template:ValTemplate:Val

Ambiguous code & minor units[edit source]

  • 10 codes are ambiguous: they appear both obsolete and active: |ANG|EUR|HRK|IDR|MWK|PEN|RON|SDG|SZL|TRY.
For example, PEN refers to an obsolete and an active currency. These have different exponents.
|is-obsolete=no/yes sets the right one. Default is: |is-obsolete=no (currency PEN is active}})
Example
PEN is ambiguous, required |is-obsolete= specifier.
USD is not ambiguous (active, |is-obsolete= is trivial)
ESA is not ambiguous (historical, List Three; |is-obsolete= is trivial)
Other not a code

PEN

|is-obsolete=1999 >< (obsolete)
|is-obsolete=no >Template:Val< (active)
|is-obsolete= >Template:Val< (active, default)
|<absent>= >Template:Val< (active, default)
is-obsolete=1999
is-obsolete=no
is-obsolete=yes

code-to-number[edit source]

  1. Code and number are 1:1 (code=number; number=code).
  2. Three codes defined to have no number: XFO, XFU, XRE (all obsolete)
  3. Template:As of: 304 existing unique alpha3-codes (over Lists One, Two and Three). Alphacode can have zero or one number (but not multiple). Numbers can repeat (eg ALL, ALK=008).
  • |format=<blank>, plain [=default]; brackets

Follows from code. Unknown code=blank. No tracking.

code-is-ambiguous[edit source]

  • 10 codes are ambiguous, they appear both obsolete and active: |ANG|EUR|HRK|IDR|MWK|PEN|RON|SDG|SZL|TRY.
For example, EUR is active in Template:Smallcaps2, and obsolete in Template:Smallcaps2 per withdrawal-date=2006-10 (List Three). Template:As of.
When such code is used, disambiguation may be required (is-obsolete=yes/no), to specify which currency is intended. This is relevant with minor-unit, and manually setting (clarifying)is-obsolete. Used in {{Infobox currency}}.
|format=ISO4217-cat: The article using an ambiguous code, will be categorised, sort under A (for checking, not an error indication).
|format=iso-code, ISO4217-cat |yes-text=anytext, <blank> (note: |yes-text=<blank> is counter-intuitive; useful for categorisation)
|yes-text=<blank> → no returntext (use for silent categorisation |ISOcat=yes)
Tracking: |ISOcat=yes: when ambiguous then → in Category:Pages using ISO 4217 currency to check (2) (catsort under A)
default USD → ><
PEN → >PEN<
|ISOcat=yes → >PEN<
|yes-text=_YES-is-ambig_ → >_YES-is-ambig_<
|yes-text=<blank> → >< Template:Purple
|yes-text=<blank>, |ISOcat=yes → >< Template:Purple
Extended content
USD → ><
FOO → ><
PEN → >PEN<
ISOcat=yes
USD → ><
FOO → ><
PEN → >PEN<
ISOcat=blank
USD → ><
FOO → ><
PEN → >PEN<
yes-text=_YES-is-ambig_
USD → ><
FOO → ><
PEN → >_YES-is-ambig_<
yes-text=<blank>
USD → ><
FOO → ><
PEN → >< Template:Purple
PEN → >< Template:Purple

code-to-withdrawal-date[edit source]

These codes are both in list-1 and list-3 (active and obsolete). So one must specify wheteher active (no |is-obsolete=<blank>, no or obsolete |withdr-date=1999, yes No tracking. Multiple witdrawal-dats possible

Used in {{ISO 4217/code-minor-unit}}

Not in mainspace[edit source]

Template:As of

code-is-obsolete[edit source]

|iso-code, is-obsolete=
{{/testcases}}

The logic[edit source]

|iso-code=, determines from ISO 4217. Thew code can be ambiguous.
|is-obsolete=: yes/no (T/F), blank='unknown'
{{yesno}} is applied: |is-obsolete=no, false=no (not obsolete, so active), |is-obsolete=<any text> is yes (obsolete)
Currency is obsolete?
|is-obsolete=T/F/unk
T=obs 01 F=act 02 unk 03
code
|iso-code=
ABC/unk

T/F/ambig/unk
T=obs 10 Template:Green 11 Template:NayTemplate:Green 12 Template:Green 13
F=act 20 Template:NayTemplate:Green 21 Template:Green 22 Template:Green 23
ambig 30 Template:Green 31 Template:Green 32 Template:Green (default) 33
unk 40 Template:Green 41 Template:Green 42 Template:Green (default) 43

Contradiction solving[edit source]

Two situations imply a contradiction: the ISO-status contradicts the entered |is-obsolete= status. This may occur when an infobox covers more than one currency. The default handling is: |is-obsolete= takes precedence. By setting |code-priority=Template:Purple gives ISO code prority (result opposite). This does not resolve the contradiction.

Currency is obsolete?
|code-priority=no (default)
|is-obsolete=T/F/unk
T=obs 01 F=act 02
code
|iso-code=...
T/F/...
T=obs 10 Template:Green 11 Template:NayTemplate:Green 12
F=act 20 Template:NayTemplate:Green 21 Template:Green 22
|code-priority=yes
Template:NayTemplate:Purple 12
Template:NayTemplate:Purple 21

Returns: when Obsolete, a text; when Active, no text (blank). On can apply this as {{#if:{{code-is-obsolete|...}}|Obsolete|Active}}.

The returntext is:

When obsolete: 1. the |is-obsolete=anytext; 2. the |withdrawal-date=, 3. |obs-text=..., 4. "OBS"
When active: 1. |act-text=... 2. <blank>
Note that, by entering a blank |obs-text=, the returntext will be a blank (so, same as default actual returntext!)


|obs-text=, |act-text= overwrites.

In {{Infobox currency}}
For |obsolete=, |obsolete= of the infobox is used: |obsolete={{{obsolete|}}}

Examples[edit source]

|iso-code=, |is-obsolete=
USD, active
  • USD ><
ATS, Austria shilling - withdrawn
  • ATS >2002-03<
PEN, PERU Nuevo Sol (ambivalent so wsdate needed)
  • PEN >< -- defaults to Active
FOO, not a code
  • FOO ><
"None", not a code
  • noNe ><
blank
  • ><

code-entity-list[edit source]

L1 [1]: PERU
L2 [0]:
L3 [1]: PERU
OBS >ACT< ambival:>2015-12<
  • COU [2]
L1 [1]: COLOMBIA
L2 [1]: COLOMBIA
L3 [0]:
OBS >ACT<
  • EUR [36]
L1 [35]: EUROPEAN UNION, ÅLAND ISLANDS, ANDORRA, AUSTRIA, BELGIUM, CYPRUS, ESTONIA, FINLAND, FRANCE, FRENCH GUIANA, FRENCH SOUTHERN TERRITORIES (THE), GERMANY, GREECE, GUADELOUPE, HOLY SEE (THE), IRELAND, ITALY, LATVIA, LITHUANIA, LUXEMBOURG, MALTA, MARTINIQUE, MAYOTTE, MONACO, MONTENEGRO, NETHERLANDS (THE), PORTUGAL, RÉUNION, SAINT BARTHÉLEMY, SAINT MARTIN (FRENCH PART), SAINT PIERRE AND MIQUELON, SAN MARINO, SLOVAKIA, SLOVENIA, SPAIN
L2 [0]:
L3 [1]: SERBIA AND MONTENEGRO
OBS >ACT< ambival:>2006-10<
  • ATS [1]
L1 [0]:
L2 [0]:
L3 [1]: AUSTRIA
OBS >2002-03<
  • USD [19]
L1 [19]: UNITED STATES OF AMERICA (THE), AMERICAN SAMOA, BONAIRE, SINT EUSTATIUS AND SABA, BRITISH INDIAN OCEAN TERRITORY (THE), ECUADOR, EL SALVADOR, GUAM, HAITI, MARSHALL ISLANDS (THE), MICRONESIA (FEDERATED STATES OF), NORTHERN MARIANA ISLANDS (THE), PALAU, PANAMA, PUERTO RICO, TIMOR-LESTE, TURKS AND CAICOS ISLANDS (THE), UNITED STATES MINOR OUTLYING ISLANDS (THE), VIRGIN ISLANDS (BRITISH), VIRGIN ISLANDS (U.S.)
L2 [0]:
L3 [0]:
OBS >ACT<
edge
  • ZZZ [0] Not an ISO 4217 code
OBS >ACT<
  • [0] Not an ISO 4217 code
OBS >ACT<

code-count[edit source]

{{ISO 4217/code-count|iso-code=|list=}}
|list, iso-code=L1, ..., L123
Number of "XYZ" code repetition per list, and over all tyhree lsits. There are 304 unique codes, repetitions make 450 different lines (code, List, entity, end-date can be repeated).
Intended for checking and listformatting only (no new information).

See Template:Slink for demo

code-to-qid[edit source]

{{ISO 4217/code-to-qid/format}}
{{ISO 4217/code-to-qid|iso-code=|format=}}
|format=plain, wl, wl-info, <blank>
Template:Property, ~265, Template:As of

Maintenance-category (ISO 4217) [edit source]

Template:Cls: →

Sets Category:Pages using ISO 4217 currency to check (2), used in various templates.
Distinguishes: mainspace (=categorise), template space (=colon-link :Category:Pages using ...), all other spaces (no effect).
{{ISO 4217/maintenance-category
|main-sort=
|template-sort=
}}
In template space: {{ISO 4217/maintenance-category}}
In the templates, activated by |ISO4217-cat= or by |format=.., ISO4217-cat, ..
Used by: {{ISO 4217/code}}, {{Infobox central bank}}, {{Infobox currency}} (projected as of October 2022)

Backoffice[edit source]

The templates[edit source]

Deployed in mainspace
{{/format}} · {{../testcases}}
Not yet used in / fit for mainspace

todo[edit source]

  • IB does cat eponym eg in euro

See also[edit source]