The Problem

The problem: how to explicitly specify a) that a figure/number relates to money; b) the currency of a stated figure; and c) the period in which that figure was current.

The currency sign cannot be used reliably since the same sign (or symbol) may represent more than one currency. eg. $ is used for many different dollars (USD, AUD, CAD...) and even other units like pesos.

The language of the page is not sufficient to define the currency of prices in the page:

More than one currency may be used by people who speak the same language.

The page may be written in one language and still quote prices/figures in a different country's currency.

Even if a country can be identified, more than one currency may be used in that country.

Converting currency figures is a reasonably easy problem to solve as indicated by the #Existing_Practices. However many automated conversion tools must make assumptions about the original figure's currency -- e.g. assuming a USD for all uses of $, or British Pounds for £ (which is also sometimes used to denote Lira).

Currency Changes

I wish to expand on one of the points mentioned above: there might be two or more currencies in the same country: e.g. in Romania

ROL - Romanian Lei [being phased out]

RON - Romanian New Lei

after Romania joins the EU, the RON will be replaced by Euro, too (not imediately, probably in 2-3 years)

Although the three letter code is different in this case, the currency is often given as Lei. There are other countries, where similar examples exist/existed. The two currencies might have an identical name, yet they have 2 very different meanings. Usually there is a difference of 3-4 orders of magnitude between the old currency and the new currency.
discoleo

Related problems

"Amounts" in arbitrary units is a bit harder and necessary for several applications.

For example, consider the work that has been done on a recipe microformat.

Though we haven't reached this problem yet in the research, I can see it
coming:

Say you wanted to create a "shopping list" application which you could tell which recipes you wanted to cook, and have it automatically total up all the various amounts of ingredients and give you the net amount of stuff you wanted to pick up.

It would need to be able to determine precise amounts/units of each ingredient. This might turn out to be like the currency problem, or it might be more complex, given the variety of units used in recipes, English vs. metric etc. That's a case that might need a microformat. We need more research and analysis to really justify it, but I can see it within the realm of probable possibility.

Individual Brainstorm Contributions

These should be collected by topic rather than author, and then perhaps cite/quote the author at the end of each paragraph instead to preserve some aspect of intent of possible opinion conveyance. - Tantek 23:16, 18 March 2013 (UTC)

Ken Griffith

Ben B's system is the most extensible of the proposals here, though it might be problematic to insert it as an inline element in a paragraph that mentions a currency amount. It would be preferable to use only inline elements.

Regarding currency codes, it will be important to use an extensible code system. ISO 4217 is great for listing national currencies. However, we need to look at how people actually use currency for transactions on the web. There are a lot of businesses and people using systems like e-gold, Webmoney, etc - several billion dollars equivalent in annual transactions - a small but steadily growing percentage of web transactions. So there should be a currency code list somewhere that can be extended beyond ISO 4217 to include private issue currency units that people actually use on the web.

"figure" is there to both explicitly associate the code, sign and amount but also allow the potential for more than one currency figure to be placed within the container. It does anticipate further development though and is the most easily dropped item at the early stage.

Although the simplest solution, it has a notable vulnerability: some currencies have/had three-letter abbreviations for their currency sign, instead of a symbol. This would make it very difficult for a parser to accurately identify such a currency.

In addition, it should be noted that the order alone cannot be used to identify which parts are code, sign and amount; since many currencies are denoted with the sign after the number.

Super shortened, but specifying a currency code as a class:

<div class="currency ABC">12345$</div>

It defines...

we're talking about money - ISO standard implied,

we're talking about the USD variety,

we're talking fifty units of that money,

a parser could work out the numbers and the symbol.

The biggest limitation I can see for that shorthand is that the currency code is not displayed visibly to human readers. The currency code is useful information to viewers and ideally should be displayed.

Shortened (including dropping 'figure', but explicitly defining and displaying the currency code. This would allow a parser to treat any remaining numbers as the amount; and any remaining a-z or symbol as the sign:

Mike Stickel

In this format the wrapping would be "money" or something similar followed by either the actual "amount" or the "currency", depending on what rules your country/language follows in regards to the order.
Since there can be a difference between different languages within countries I thought it might be a good idea to include that in the "currency" definition of the formating, eg., "CAD eng" or "CAD fr".
It could also give sites that list multiple languages a way to differentiate when they show multiple prices.

Good idea, but shouldn't a Microformat use existing markup for language attributes, eg.

symbol - class (optional - so that we know whether the symbol is present; or whether it needs to be generated by the user agent; it will also help user agents to ignore $ and other such symbols, when used for purposes other than to indicate a currency, or to remove them, when translating to a different currency.)

unit - class (subdivison of currency; use as "symbol")

equivalence - class (optional; conversion should be done by the user agent. Do we need this? Does it need a numeric value?)

On
<span class="currency">
<abbr class=date" title="1922-08-01>August 1</abbr>,
the US Dollar still stood at
<span class="value">643</span>
<abbr class="type="GDM">Marks</abbr>
</span>
to the Dollar. But on
<span class="currency">
<abbr class=date" title="1922-09-05>September 5</abbr>
the dollar had already risen to
<span class="value">1,440</span>
<abbr class="type="GDM">Marks</abbr></span>
</span>

Is there anything sensible which can't be done with the above?

Assumptions

Working out values in secondary currencies is a (real-time or daily) job for server-side scripting or user agents.

If "£" is an abbreviation, then its title is "pounds sterling"; though note that "£5" is pronounced as "five pounds sterling" (commonly just "five pounds") and not: "pounds sterling five" in the same way that "$5" is pronounced as: "five dollars" and not "dollars five"

Issues

There will be complications where the entire currency has disappeared, (such as the last example; French Francs into Euros).

Where no symbol or unit is involved (chiefly in tables, where they will be in the header cell), should we allow:

Gary Jones

If the formatting of a currency is such that the type symbol comes after the value, then simply swap the order of the elements containing the type and value classes.

I do think that the use of "type" and "value" classes would be better than variations of "currency_symbol" and "amount". It follows the same principles as some other elemental formats (value excerpting), meaning it's easier to remember and implement, and even ISO4217 has codes for "currencies" that don't use symbols:

Following on from this, the use of a "money" class should not be used; currency does not have to be money, and having a "metal" class starts to make it convoluted. Currency is the parent of money, not the other way around.

In the above, a number is assumed because their is not an "amount", and the number digit is the currency symbol. I guess what I'm saying is if there is a number in the HTML and it is the correct number (which I think will be the 80 percentile case, give or take, then why require additional markup for it?)

On
<span class="currency">
<abbr class=date" title="1922-08-01>August 1</abbr>,
the US Dollar still stood at
<span class="value">643</span>
<abbr class="type="GDM">Marks</abbr>
</span>
to the Dollar. But on
<span class="currency">
<abbr class=date" title="1922-09-05>September 5</abbr>
the dollar had already risen to
<span class="value">1,440</span>
<abbr class="type="GDM">Marks</abbr></span>
</span>

My efforts attempt to minimize the disruption in the HTML file and only use additional markup when absolutely required. I believe some high volume websites still try to minimize the markup they serve, and this is bloated as it it. They may decide just to serve up a few digits rather than 50 character per price, especially on pages with lots of prices.

Taylor Cowan

Pretending to forget all that we've know up till now about microformats, what if we just wanted a way for web page designers to make their currency amounts unambiguous with respect to currency denomination and amount?

Using amount suffixes such as K, M, B, or T are not necessarily supported by any International Standard. Shouldn't we just say that the complete number should be used in the <abbr> element? ManuSporny 12:31, 5 Oct 2007 (PDT)

Suggested amendments

Use just the abbr pattern and format [number]space[currency-code]. We should narrow our focus to make progress. Simplify, simplify, simplify! ManuSporny 07:16, 5 Oct 2007 (PDT)

. You could argue that "5 GBP" is not an abbreviation of "5GBP", which is true - but I believe this is an acceptable compromise, afterall... we would be arguing over a single space character, which seems a bit pedantic. ManuSporny 11:52, 5 Oct 2007 (PDT)