• Home
  • Random
  • Log in
  • Settings
  • About English Wikipedia @ Freddythechick
English Wikipedia @ Freddythechick

Template:ISO 4217/code

  • Language
  • Watch
  • View source
< Template:ISO 4217
Template documentation[view] [edit] [history] [purge]

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}}, as of October 2022[update]).

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

  • (P498)

Contents

  • 1 General
  • 2 Base: iso-code
    • 2.1 ISO 4217/code
      • 2.1.1 iso-code error (maintenance category)
      • 2.1.2 option-none (code='None')
      • 2.1.3 Examples
  • 3 Derived value templates
    • 3.1 minor unit
      • 3.1.1 Ambiguous code & minor units
    • 3.2 code-to-number
    • 3.3 code-is-ambiguous
    • 3.4 code-to-withdrawal-date
  • 4 Not in mainspace
    • 4.1 code-is-obsolete
      • 4.1.1 The logic
      • 4.1.2 Contradiction solving
      • 4.1.3 Examples
    • 4.2 code-entity-list
    • 4.3 code-count
    • 4.4 code-to-qid
  • 5 Maintenance-category (ISO 4217)
  • 6 Backoffice
    • 6.1 The templates
  • 7 todo
  • 8 See also

General

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

Most parameters work by {{yesno}} principle: <syntaxhighlight lang="text" class="" style="" inline="1">yes, 1, true, <anytext></syntaxhighlight> and <syntaxhighlight lang="text" class="" style="" inline="1">no, 0, false, <blank></syntaxhighlight> are recognised as T/F.

See also § maintenance-category ISO 4217
|format=-options can be comma-separated list: |format=option-none, ISO4217-cat, mono, brackets, (as announced per template)

Base: iso-code

ISO 4217/code

  • {{ISO 4217/code}}

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 § maintenance-category ISO4217

Other data (ref, comment) elsewhere. Data as of 17 October 2022[update], per source {{ISO 4217/cite}}

iso-code error (maintenance category)

|format=ISO4217-cat will categorise articles with ISO-codes that do not exist in ISO. Sorted under <syntaxhighlight lang="text" class="" style="" inline="1">C</syntaxhighlight>.
(When in Template space, a wikilink to the category will show: |iso-code=ZZZ → ISOcat-C*)
See § maintenance-category ISO4217

option-none (code='None')

|format=option-none will allow |iso-code=''None'', none, no (formatting is optional).
  • {{ISO 4217/code-none}} will return (show) |iso-code=''None'' (as formatted).
Internally, {{ISO 4217/code-none}} returns <syntaxhighlight lang="text" class="" style="" inline="1">_NONE_</syntaxhighlight> 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 <syntaxhighlight lang="text" class="" style="" inline="1">N</syntaxhighlight>.

(In Template space: |iso-code=None → ISOcat-N*)
See § maintenance-category ISO4217

Examples

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

Derived value templates

minor unit

  • "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.01 (dollarcent unit).

Occurring values are: <syntaxhighlight lang="text" class="" style="" inline="1"><blank>, N.A., 0, 2, 3, 4</syntaxhighlight>. So, incidentally, <syntaxhighlight lang="text" class="" style="" inline="1">1</syntaxhighlight> (for ¤ 0.1) is not present. Obsolete currency (historical, List Three): has no minor unit ("blank").

  • {{ISO 4217/code-minor-unit}}
In enwiki: "<blank>", "N.A.", "0" all return blank, because "¤ 1" is not a subunit of "¤ 1".
|iso-code=, |is-obsolete=, |format=blank/default (0.001-form), exponent (N.A., <blank>, 0, 2, 3, 4)
Examples
<blank> AFA: →
N.A. XPD: N.A. →
0 KRW: →
1 (not present)
2 RUB: 2 → 0.01
3 OMR: 3 → 0.001
4 CLF: 4 → 0.0001

Ambiguous code & minor units

  • 10 codes are ambiguous: they appear both obsolete and active: <syntaxhighlight lang="text" class="" style="" inline="1">|ANG|EUR|HRK|IDR|MWK|PEN|RON|SDG|SZL|TRY</syntaxhighlight>.
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
<syntaxhighlight lang="text" class="" style="" inline="1">PEN</syntaxhighlight> is ambiguous, required |is-obsolete= specifier.
<syntaxhighlight lang="text" class="" style="" inline="1">USD</syntaxhighlight> is not ambiguous (active, |is-obsolete= is trivial)
<syntaxhighlight lang="text" class="" style="" inline="1">ESA</syntaxhighlight> is not ambiguous (historical, List Three; |is-obsolete= is trivial)
<syntaxhighlight lang="text" class="" style="" inline="1">Other</syntaxhighlight> not a code

PEN

|is-obsolete=1999 >< (obsolete)
|is-obsolete=no >0.01< (active)
|is-obsolete= >0.01< (active, default)
|<absent>= >0.01< (active, default)
  • USD >0.01<
  • PEN >0.01<
  • FOO ><
  • blank ><
is-obsolete=1999
  • USD >0.01<
  • PEN ><
  • FOO ><
  • blank ><
is-obsolete=no
  • USD >0.01<
  • PEN >0.01<
  • FOO ><
  • blank ><
is-obsolete=yes
  • USD >0.01<
  • PEN ><
  • FOO ><
  • blank ><

code-to-number

  • {{ISO 4217/code-to-number}} ({{../format}})
  1. Code and number are 1:1 (code=number; number=code).
  2. Three codes defined to have no number: <syntaxhighlight lang="text" class="" style="" inline="1">XFO, XFU, XRE</syntaxhighlight> (all obsolete)
  3. As of 17 October 2022[update]: 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

  • 10 codes are ambiguous, they appear both obsolete and active: <syntaxhighlight lang="text" class="" style="" inline="1">|ANG|EUR|HRK|IDR|MWK|PEN|RON|SDG|SZL|TRY</syntaxhighlight>.
For example, EUR is active in GERMANY, and obsolete in SERBIA AND MONTENEGRO per withdrawal-date=2006-10 (List Three). As of 17 October 2022[update].
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 <syntaxhighlight lang="text" class="" style="" inline="1">A</syntaxhighlight> (for checking, not an error indication).
  • {{ISO 4217/code-is-ambiguous}}
|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 (4) (catsort under A)
default <syntaxhighlight lang="text" class="" style="" inline="1">USD</syntaxhighlight> → ><
<syntaxhighlight lang="text" class="" style="" inline="1">PEN</syntaxhighlight> → >PEN<
|ISOcat=yes → >PEN<
|yes-text=_YES-is-ambig_ → >_YES-is-ambig_<
|yes-text=<blank> → >< So status=yes, but yes-returntext is suppressed
|yes-text=<blank>, |ISOcat=yes → >< So status=yes, but yes-returntext is suppressed
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 → >< So status=yes, but yes-returntext is suppressed
PEN → >< So status=yes, but yes-returntext is suppressed

code-to-withdrawal-date

  • {{ISO 4217/code-to-withdrawal-date}}
  • Note: |is-obsolete=yes/no required for ambivalent currencies: <syntaxhighlight lang="text" class="" style="" inline="1">ANG, EUR, HRK, IDR, MWK, PEN, RON, SDG, SZL, TRY</syntaxhighlight>

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

As of 1 Nov 2022[update]

code-is-obsolete

  • Template:ISO 4217/code-is-obsolete (backlinks edit) returns ISO withdrawal-date or blank.
  • Template:ISO 4217/code-is-obsolete/calc (backlinks edit) returns ISO withdrawal-date or blank.
|iso-code, is-obsolete=
{{/testcases}}

The logic

|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=<syntaxhighlight lang="text" class="" style="" inline="1">no</syntaxhighlight> (not obsolete, so active), |is-obsolete=<any text> is <syntaxhighlight lang="text" class="" style="" inline="1">yes</syntaxhighlight> (obsolete)
Currency is obsolete?
|is-obsolete=T/F/unk
T=obs 01 F=act 02 unk 03
code
|iso-code=
ABC/unk

→<syntaxhighlight lang="text" class="" style="" inline="1">T/F/ambig/unk</syntaxhighlight>
T=obs 10 OBS 11 Red XN→ACT 12 OBS 13
F=act 20 Red XN→OBS 21 ACT 22 ACT 23
ambig 30 OBS 31 ACT 32 ACT (default) 33
unk 40 OBS 41 ACT 42 ACT (default) 43
  • Red XN Contradicting situation: Obsolete vs. Active. By default |code-priority=no, so |is-obsolete=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=yes 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=...
→<syntaxhighlight lang="text" class="" style="" inline="1">T/F/...</syntaxhighlight>
T=obs 10 OBS 11 Red XN→ACT 12
F=act 20 Red XN→OBS 21 ACT 22
|code-priority=yes
Red XN→OBS 12
Red XN→ACT 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. "<syntaxhighlight lang="text" class="" style="" inline="1">OBS</syntaxhighlight>"
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

|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

  • Template:ISO 4217/code-entity-list (backlinks edit) ( {{../demo}} · edit )
  • PEN [2]
<syntaxhighlight lang="text" class="" style="" inline="1">L1</syntaxhighlight> [1]: PERU
<syntaxhighlight lang="text" class="" style="" inline="1">L2</syntaxhighlight> [0]:
<syntaxhighlight lang="text" class="" style="" inline="1">L3</syntaxhighlight> [1]: PERU
<syntaxhighlight lang="text" class="" style="" inline="1">OBS</syntaxhighlight> >ACT< ambival:>2015-12<
  • COU [2]
<syntaxhighlight lang="text" class="" style="" inline="1">L1</syntaxhighlight> [1]: COLOMBIA
<syntaxhighlight lang="text" class="" style="" inline="1">L2</syntaxhighlight> [1]: COLOMBIA
<syntaxhighlight lang="text" class="" style="" inline="1">L3</syntaxhighlight> [0]:
<syntaxhighlight lang="text" class="" style="" inline="1">OBS</syntaxhighlight> >ACT<
  • EUR [36]
<syntaxhighlight lang="text" class="" style="" inline="1">L1</syntaxhighlight> [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
<syntaxhighlight lang="text" class="" style="" inline="1">L2</syntaxhighlight> [0]:
<syntaxhighlight lang="text" class="" style="" inline="1">L3</syntaxhighlight> [1]: SERBIA AND MONTENEGRO
<syntaxhighlight lang="text" class="" style="" inline="1">OBS</syntaxhighlight> >ACT< ambival:>2006-10<
  • ATS [1]
<syntaxhighlight lang="text" class="" style="" inline="1">L1</syntaxhighlight> [0]:
<syntaxhighlight lang="text" class="" style="" inline="1">L2</syntaxhighlight> [0]:
<syntaxhighlight lang="text" class="" style="" inline="1">L3</syntaxhighlight> [1]: AUSTRIA
<syntaxhighlight lang="text" class="" style="" inline="1">OBS</syntaxhighlight> >2002-03<
  • USD [19]
<syntaxhighlight lang="text" class="" style="" inline="1">L1</syntaxhighlight> [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.)
<syntaxhighlight lang="text" class="" style="" inline="1">L2</syntaxhighlight> [0]:
<syntaxhighlight lang="text" class="" style="" inline="1">L3</syntaxhighlight> [0]:
<syntaxhighlight lang="text" class="" style="" inline="1">OBS</syntaxhighlight> >ACT<
edge
  • ZZZ [0] Not an ISO 4217 code
<syntaxhighlight lang="text" class="" style="" inline="1">OBS</syntaxhighlight> >ACT<
  • [0] Not an ISO 4217 code
<syntaxhighlight lang="text" class="" style="" inline="1">OBS</syntaxhighlight> >ACT<

code-count

  • Template:ISO 4217/code-count (backlinks edit)

<syntaxhighlight lang="wikitext">

</syntaxhighlight>

|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 § code-entity-list for demo

code-to-qid

  • Template:ISO 4217/code-to-qid (backlinks edit)
{{ISO 4217/code-to-qid/format}}

<syntaxhighlight lang="wikitext"> Template:ISO 4217/code-to-qid </syntaxhighlight>

|format=plain, wl, wl-info, <blank>
(P498), ~265, As of 08:58, 13 November 2022 (UTC)[update]

Maintenance-category (ISO 4217)

Cat:ISO 4217: →

  • {{ISO 4217/maintenance-category}}
Sets Category:Pages using ISO 4217 currency to check (4), used in various templates.
Distinguishes: mainspace (=categorise), template space (=colon-link :Category:Pages using ...), all other spaces (no effect).

<syntaxhighlight lang="wikitext"> [[:Category:Pages using ISO 4217 currency to check|]]</syntaxhighlight>

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

The templates

Deployed in mainspace
  • Template:ISO 4217/cite (backlinks edit)
  • Template:ISO 4217/code (backlinks edit)
{{/format}} · {{../testcases}}
  • {{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}} (Category:Pages using ISO 4217 currency to check (4))
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

See also

  • v
  • t
  • e
ISO 4217 templates
T:ISO 4217 * · T:IB Currency *
ISO 4217
{{ISO 4217}} (talk)
{{ISO 4217/cite}}
  • website: {{ISO 4217/cite/SIX Group}}
  • L1 {{ISO 4217/cite/List One}}
  • L2 {{ISO 4217/cite/List Two}}
  • L3 {{ISO 4217/cite/List Three}}
  • Amend {{ISO 4217/cite/Amendments}}
    • Data Analysis
{{ISO 4217/code}}
  • {{/doc}}
    • {{/testcases}}
    • {{/demo}}
  • {{/count}}
  • {{/entity-list}}
  • {{/code-none}}
  • {{/is-ambiguous}}
  • {{/minor}}
  • {{/number}}
  • {{/qid}}
  • {{/maintenance-category}}
  • Hist: {{/is-obsolete}} β
  • {{/withdr-date}} β
{{Infobox currency}}
  • Infobox currency/sandbox (edit · t · history · diff · links · /test · Source · e · t · hist · links · /subpages · /doc · /doc edit) TPU
Other
  • {{Infobox cryptocurrency}} TPU
  • {{Infobox central bank}} TPU
  • wl: {{Iso4217}}
  • fmt: {{BDT}}
  • ISO 4217:CHE (R)
Wikidata 
  • (Q37431)
  • (P498) [sparql 307/TRY2x; 28Nov2022]
  • Category:ISO 4217
  • Category:Pages using ISO 4217 currency to check‎ (4)
  • Category:Pages using Infobox currency with unknown parameters (1) · Category:Pages using Infobox currency to check (70)
  • Category:Redirects from ISO 4217 codes (155)
  • Category:Redirects from obsolete ISO 4217 codes (6)
The above documentation is transcluded from Template:ISO 4217/code/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (edit) pages.
Subpages of this template.
Retrieved from "https://enwiki.freddythechick.net/index.php?title=Template:ISO_4217/code&oldid=2179177"
Last edited on 20 June 2024, at 16:53

Languages

      This page is not available in other languages.

      English Wikipedia @ Freddythechick
      • This page was last edited on 20 June 2024, at 16:53.
      • Content is available under Creative Commons Attribution-ShareAlike 4.0 unless otherwise noted.
      • About English Wikipedia @ Freddythechick
      • Desktop