currency-proposal: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(Added feature/benefit)
(Precised the meaning of currency and unit)
Line 26: Line 26:


* Required <code>amount</code>: can mark up a machine-readable numerical value with a <code>span</code>element or a string value with a <code>abbr</code> whose <code>title</code> attribute contains the machine-readable numerical value (See [[abbr-design-pattern]]).
* Required <code>amount</code>: can mark up a machine-readable numerical value with a <code>span</code>element or a string value with a <code>abbr</code> whose <code>title</code> attribute contains the machine-readable numerical value (See [[abbr-design-pattern]]).
* Optional <code>currency unit</code>, or reference to a currency unit (See [[include-pattern]]). Must contain a ISO 4217 compliant code.
* Optional <code>currency</code>, or reference to a currency (See [[include-pattern]]). Must markup a ISO 4217 compliant code or use the [[abbr-design-pattern]] to provide the equivalent ISO 4217 machine readable value to the marked up human-readable value.
* Optional <code>unit</code>, or reference to a unit of the currency (See [[include-pattern]]), for instance a "dollar" or "cent". This proposal does not specify how the unit must be marked up. This is the focus of the [[measure]] microformats.
* Optional <code>date</code> following the [[datetime-design-pattern]], specifies the date that must be used to evaluate the value of the currency unit used.
* Optional <code>date</code> following the [[datetime-design-pattern]], specifies the date that must be used to evaluate the value of the currency unit used.



Revision as of 18:07, 11 October 2006

Currency

currency is a simple microformat for marking up money amounts, such as prices of products/services or financial facts.

Introduction

Money amounts are one of the most widespread content found on the Web, but the lack of unambiguous representation of the currency they are expressed in, or the date that they relate to, makes comparison and matching of offerings online difficult.

Scope

This proposal limits its scope to:

  • money amounts expressed in one officially issued coins and notes. This means it currently does not support money amounts expressed in terms of commodities or other liquefiable asset.
  • money amounts expressed in one unit. This means that it currently does not support composite amounts such as "39 U.S. Dollars and 99 Cents".

Features

  • Reuse of widely used ISO 4217 for unambiguous encoding of currency types: ensures interoperability with many existing and emerging industry standards such as IFX, ACORD, XBRL or UBL.
  • Define currency once, use anywhere: allows currency units to be defined once and then referred to, instead of locally defined for each money amount, resulting in ease of readability for both human users and their user agents.
  • Timestamping: money amounts have an optional date that allows user agents to translate a historical figure to an equivalent present amount.

Root Class Name

The root class name for a money amount is money.

Property List

  • Required amount: can mark up a machine-readable numerical value with a spanelement or a string value with a abbr whose title attribute contains the machine-readable numerical value (See abbr-design-pattern).
  • Optional currency, or reference to a currency (See include-pattern). Must markup a ISO 4217 compliant code or use the abbr-design-pattern to provide the equivalent ISO 4217 machine readable value to the marked up human-readable value.
  • Optional unit, or reference to a unit of the currency (See include-pattern), for instance a "dollar" or "cent". This proposal does not specify how the unit must be marked up. This is the focus of the measure microformats.
  • Optional date following the datetime-design-pattern, specifies the date that must be used to evaluate the value of the currency unit used.

Examples

Simple in-line example with local definition of the currency unit: $39.99

<span class="money"><abbr class="currency unit" title="USD">$</abbr><span class="amount">39.99</span></span>

Text representation of the amount: Thirty-nine Dollars

<span class="money"><abbr class="amount" title="39">Thirty-nine</abbr> <abbr class="currency unit" title="USD">Dollars</abbr></span>

Table example with global definition of the currency unit:

   <table>
      <tr><th>Price in <abbr id="u1" class="currency unit" title="USD">US$</abbr></th></tr>
      <tr><td><div class="money">39.99<a href="#u1" class="include"></a></div></td></tr>
   </table>