Template:ISO 4217/code/doc

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, ).

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

 * iso-code
 * format
 * is-obsolete

Most parameters work by yesno principle: yes, 1, true, and no, 0, false, are recognised as T/F.
 * See also


 * format-options can be comma-separated list: option-none, ISO4217-cat, mono, brackets, (as announced per template)

ISO 4217/code
Returns valid ISO 4217 code or blank.
 * ISO 4217/code
 * iso-code


 * Basic: &lt;blank&gt; returns EITHER the code as exists OR &lt;blank&gt; (no tracking etc)


 * option-none, ISO4217-cat


 * See

Other data (ref, comment) elsewhere. Data, per source ISO 4217/cite

iso-code error (maintenance category)

 * 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: ZZZ &rarr; )


 * See

option-none (code='None')

 * option-none will allow None, none, no (formatting is optional).


 * ISO 4217/code-none will return (show) None (as formatted).


 * Internally, ISO 4217/code-none returns _NONE_ or &lt;blank>.

When code "None" is not allowed option-none, None input is considered unrecognised code (returns blank). Will be categorised from mainspace, sorted under N.
 * (In Template space: None &rarr; )
 * See

minor unit
Occurring values are:, N.A., 0, 2, 3, 4. So, incidentally, 1 (for $0.01$) is not present. Obsolete currency (historical, List Three): has no minor unit ("blank").
 * "Minor unit" in ISO 4217: number of decimals for minor unit used in currency trade. For example, USD has Minor unit=2, i.e. $0.1$ (dollarcent unit).


 * ISO 4217/code-minor-unit
 * In enwiki: "&lt;blank>", "N.A.", "0" all return blank, because "$1$" is not a subunit of "$1$".


 * iso-code, is-obsolete, blank/default (0.001-form), exponent (N.A., &lt;blank&gt;, 0, 2, 3, 4)


 * Examples
 * &lt;blank> AFA: &rarr;
 * N.A. XPD: &rarr;
 * 0 KRW: &rarr;
 * 1 (not present)
 * 2 RUB: &rarr;
 * 3 OMR: &rarr;
 * 4 CLF: &rarr;

Ambiguous code & minor units

 * 10 codes are ambiguous: they appear both obsolete and active: ANG.
 * For example, PEN refers to an obsolete and an active currency. These have different exponents.
 * no/yes sets the right one. Default is: 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
 * 1999 >< (obsolete)
 * no >< (active)
 * is-obsolete >< (active, default)
 * &lt;absent> >< (active, default)


 * USD ><
 * PEN ><
 * FOO ><
 * blank ><


 * is-obsolete=1999
 * USD ><
 * PEN ><
 * FOO ><
 * blank ><


 * is-obsolete=no
 * USD ><
 * PEN ><
 * FOO ><
 * blank ><


 * is-obsolete=yes
 * USD ><
 * PEN ><
 * FOO ><
 * blank ><

code-to-number



 * Code and number are 1:1 (code=number; number=code).
 * Three codes defined to have no number: XFO, XFU, XRE (all obsolete)
 * 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

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

code-is-ambiguous

 * 10 codes are ambiguous, they appear both obsolete and active: ANG.
 * For example, EUR is active in, and obsolete in per withdrawal-date=2006-10 (List Three)..


 * 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.


 * ISO4217-cat: The article using an ambiguous code, will be categorised, sort under A (for checking, not an error indication).


 * iso-code, ISO4217-cat anytext, &lt;blank> (note: &lt;blank> is counter-intuitive; useful for categorisation)
 * iso-code, ISO4217-cat anytext, &lt;blank> (note: &lt;blank> is counter-intuitive; useful for categorisation)


 * &lt;blank> &rarr; no returntext (use for silent categorisation yes)
 * Tracking: yes: when ambiguous then &rarr; in  (catsort under A)
 * default USD &rarr; ><
 * PEN &rarr; ><
 * yes &rarr; ><
 * _YES-is-ambig_ &rarr; ><
 * &lt;blank> &rarr; ><
 * &lt;blank>, yes &rarr; ><


 * USD &rarr; ><
 * FOO &rarr; ><
 * PEN &rarr; ><


 * ISOcat=yes
 * USD &rarr; ><
 * FOO &rarr; ><
 * PEN &rarr; ><


 * ISOcat=blank
 * USD &rarr; ><
 * FOO &rarr; ><
 * PEN &rarr; ><


 * yes-text=_YES-is-ambig_
 * USD &rarr; ><
 * FOO &rarr; ><
 * PEN &rarr; ><


 * yes-text=&lt;blank>
 * USD &rarr; ><
 * FOO &rarr; ><
 * PEN &rarr; ><
 * PEN &rarr; ><

code-to-withdrawal-date
These codes are both in list-1 and list-3 (active and obsolete). So one must specify wheteher active (no &lt;blank>, no or obsolete 1999, yes No tracking. Multiple witdrawal-dats possible
 * ISO 4217/code-to-withdrawal-date
 * Note: yes/no required for ambivalent currencies: ANG, EUR, HRK, IDR, MWK, PEN, RON, SDG, SZL, TRY
 * Used in ISO 4217/code-minor-unit

code-is-obsolete

 * ISO 4217/code-is-obsolete returns ISO withdrawal-date or blank.
 * ISO 4217/code-is-obsolete/calc returns ISO withdrawal-date or blank.
 * iso-code, is-obsolete



The logic

 * iso-code, determines from ISO 4217. Thew code can be ambiguous.
 * is-obsolete: yes/no (T/F), blank='unknown'
 * is applied: no, false=no (not obsolete, so active), &lt;any text> is yes (obsolete)


 * ❌ Contradicting situation: Obsolete vs. Active. By default code-priority, so T/F decides.

Contradiction solving
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 gives ISO code prority (result opposite). This does not resolve the contradiction.

Returns: when Obsolete, a text; when Active, no text (blank). On can apply this as.

The returntext is:
 * When obsolete: 1. the anytext; 2. the withdrawal-date, 3. ..., 4. "OBS"
 * When active: 1. ... 2. &lt;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
 * For obsolete, obsolete of the infobox is used: obsolete

Examples

 * iso-code, is-obsolete


 * USD, active


 * USD ><
 * ATS, Austria shilling - withdrawn


 * ATS ><
 * 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

 * ISO 4217/code-entity-list ( · )


 * edge

code-count

 * ISO 4217/code-count
 * 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 for demo

code-to-qid

 * ISO 4217/code-to-qid
 * ISO 4217/code-to-qid/format


 * plain, wl, wl-info, &lt;blank>
 * , ~265,

Maintenance-category (ISO 4217)

 * &rarr;
 * ISO 4217/maintenance-category
 * Sets, used in various templates.
 * Distinguishes: mainspace (=categorise), template space (=colon-link Category:Pages using ...), all other spaces (no effect).


 * In template space:
 * In the templates, activated by ISO4217-cat or by .., ISO4217-cat, ..


 * Used by: ISO 4217/code, Infobox central bank, Infobox currency (projected as of October 2022)

The templates

 * Deployed in mainspace:
 * ISO 4217/cite
 * ISO 4217/code


 * ISO 4217/code-minor-unit
 * ISO 4217/code-to-number
 * ISO 4217/code-is-ambiguous
 * ISO 4217/code-none
 * ISO 4217/code-count


 * ISO 4217/maintenance-category


 * Not yet used in / fit for mainspace
 * ISO 4217/code-to-withdrawal-date
 * ISO 4217/code-is-obsolete
 * ISO 4217/code-entity-list
 * ISO 4217/code-to-qid -- curation; dated (13 Nov 2022)

todo

 * IB does cat eponym eg in euro