From Microformats Wiki
currency-examples /
Revision as of 09:49, 19 July 2006 by Steve Ganz (talk | contribs) (Added examples in the wild and brainstorming that took place on uf-discuss)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Currency Examples

The following are real-world examples and brainstorming for marking up currency.

The Problem

Currency is a reasonably easy problem to solve as indicated by the #Existing_Practices.

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


  • Ben Buchanan
  • Charles Iliya Krempeaux
  • Ben Ward
  • Arve Bersvendsen
  • Mike Stickel
  • Ciaran McNulty
  • Tantek Çelik
  • Steve Ganz

Real-World Examples

Links to public web pages, either popular or insightful


<span class="price">$39.99 <span class="currency">(USD)</span></span>


<td class="price">$34.85</td>

Bell Canada in French Canadian

<font size="larger"><b>Niveau de service Premium - 125 $*</b></font size>

Note the placement of the dollar sign AFTER the number.

Bell Canada in US English

<font size="larger"><b>Premium Service Level - $125*</b></font size>

Existing Practices

Firefox Extension

Firefox Currency Converter - ViewMyCurrency

Greasemonkey Scripts


Yahoo! Finance Currency Converter

ISO 4217 Codes


Charles Iliya Krempeaux

Maybe something like...

Pay me <abbr class="currency" title="CAD">$</abbr>5.00 now!

Although something like the the following might be better...

Pay me <span class="money"><abbr class="currency" title="CAD">$</abbr>5.00</span> now!

But it might be more semantic salt than is considered necessary. Just having the abbr with the class-currency near a number might be good enough. But that's open for discussion though.

Ben Ward

Could pure HTML be sufficient?

<html lang="en-gb">
<p>My new T-Shirts cost £30, but it cost my friend in Canada <span lang="en-ca">$34</span></p> 

Arve Bersvendsen

<p lang="nb">Den kanadiske prisen på t-skjorten var <span class="currency CAD">34 $</span>.</p>

Mike Stickel

<span class="money"><abbr class="currency" title="CAD eng">$</abbr><span class="amount">5.00</span></span>

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.

Ciaran McNulty

The only microformat that I've noticed currency units in is hListing draft, and that deliberately shies away from parsing the actual values because it's too free-form in most existing Listing formats.

My own preference would be for something like:

<p class="money">This item costs
  <span class="currency">GBP</span>
  <span class="amount">10.00</span>

Which with similar parsing rules to existing formats would also allow things like:

<p class="money">
  It'll cost you
  <abbr class="currency" title="50.00">fifty</abbr>
  <abbr class="amount" title="GBP">quid</abbr>
  , mate!

Or, a more complex example with multiple languages:

<p lang="en">
<span class="money">
 <abbr class="currency" title="GBP">£</abbr>  <span class="amount">1,250.00</span> </span> <span lang="fr" class="money">
 <span class="amount">1600,00</span>
 <abbr class="currency" title="EUR">€</abbr>

See Also