currency-examples: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
m (Replace <entry-title> with {{DISPLAYTITLE:}})
 
(68 intermediate revisions by 18 users not shown)
Line 1: Line 1:
= Currency Examples =
{{DISPLAYTITLE: Currency Examples }}
<p>The following are real-world examples and brainstorming for marking up currency.</p>
The following are real-world [[examples]] of pages that have amounts of money that could be marked up with a '''[[currency]]''' microformat. As part of the microformats process:
* [[currency-examples]]
* [[currency-formats]]
* [[currency-brainstorming]]


== The Problem ==
== Real-World Examples ==
''Links to public web pages, either popular or insightful''
 
===Google Financials===
Use of currency amounts in tables.


<p>The problem: how to explicitly specify the currency of a stated figure.</p>
Representing currency amounts in a table format is very common. For instance, see [http://investor.google.com/fin_data.html Google Financials].


<ul>
In this table representation, it does not make sense to provide the currency information for each cell. Instead, it should be provided once at the table, thead, tr, or th, level, and then a td may override the default value. This is very similar to the common practice of indicating the currency and formatting in plain english: "Numbers in thousands of dollars" in the table title/subtitle or legend.
  <li>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 [http://en.wikipedia.org/wiki/Currency_sign#Examples other units like pesos].</li>
 
  <li>The language of the page is not sufficient to define the currency of prices in the page:
The microformat for currency amounts should provide a way to represent a default currency for all children of a table, thead, tr, or th nodes.  
    <ul>
The currency symbol/abbreviation should be optional in for elements defined as containing currency values/amounts, if a default currency has been defined in one of the ancestor elements.
      <li>More than one currency may be used by people who speak the same language.</li>
      <li>The page may be written in one language and still quote prices/figures in a different country's currency.</li>
      <li>Even if a country can be identified, more than one currency may be used in that country.</li>
    </ul>
  </li>
</ul>


<p>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 - eg. assuming a USD for all uses of $, or British Pounds for £ (which is also [http://en.wikipedia.org/wiki/Lira sometimes used to denote Lira]).</p>
=== UK Government Data Standards Catalogue ===


===Related problems===
[http://www.govtalk.gov.uk/gdsc/html/frames/AmountSterling-1-0-Release.htm UK Government Data Standards Catalogue]
<p>"Amounts" in arbitrary units is a bit harder and necessary for several applications.</p>


<p>For example, consider the work that has been done on a recipe microformat.</p>
The [http://www.govtalk.gov.uk/gdsc/schemaHtml/FinancialTypes-v1-1-xsd-AmountSterlingStructure.htm associated XML Schema] seems to suggest an ''Amount'' element, followed by a fixed ''Currency'' element of "GBP".


[[recipe-examples]]
=== SkypeOut Pricing ===
[http://www.skype.com/products/skypeout/ SkypeOut Pricing].


<p>Though we haven't reached this problem yet in the research, I can see it
<pre>2.1 US cents/2.4 CAN cents per minute</pre> (on the Web page)
coming:</p>


<p>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.</p>
<pre>&cent;2.1 USD (or &cent;2.4 CAD) per minute.</pre> (in the announcement email)


<p>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.</p>
See also [[measure]]


== Participants ==
=== MIT Enterprise Forum ===
* [http://weblog.200ok.com.au/ Ben Buchanan]
[http://enterpriseforum.mit.edu/mindshare/startingup/dilution.html MIT Enterprise Forum ].
* Charles Iliya Krempeaux
* Ben Ward
* Arve Bersvendsen
* Mike Stickel
* Ciaran McNulty
* [http://tantek.com/log/ Tantek Çelik]
* [http://steve.ganz.name/ Steve Ganz]


== Real-World Examples ==
<pre>$1 million in equity</pre>
''Links to public web pages, either popular or insightful''
=== [http://us.mcafee.com/root/package.asp?pkgid=100 McAfee] ===
<pre>
<span class="price">$39.99 <span class="currency">(USD)</span></span>
</pre>


=== [http://www.amazon.com/gp/product/0764597582/sr=8-9/qid=1153301402/ref=sr_1_9/002-9103678-0608852?ie=UTF8 Amazon] ===
<pre>$2.50 a share</pre>


<pre><td class="price">$34.85</td></pre>
See also [[measure]]


=== [https://secure.vmp.com/signup/adv_signup.php?locale=fr_CA Bell Canada in French Canadian] ===
=== Energy Information Administration ===
[http://tonto.eia.doe.gov/oog/info/ngw/historical/2004/06_24/ngupdate.asp Energy Information Administration].


<pre><font size="larger"><b>Niveau de service Premium - 125 $*</b></font size></pre>
<pre>23 cents per barrel</pre>


Note the placement of the dollar sign AFTER the number.
Also in this [http://www.eia.doe.gov/emeu/international/oilprice.html page]:


=== [https://secure.vmp.com/signup/adv_signup.php?locale=en_US Bell Canada in US English] ===
<pre>(U.S. Cents per Gallon)</pre>


<pre><font size="larger"><b>Premium Service Level - $125*</b></font size></pre>
<pre>(Euros per Thousand Liters)</pre>


== Existing Practices ==
<pre>(U.S. Dollars per Gallon)</pre>


===Firefox Extension===
See also [[measure]]
[http://viewmycurrency.wordpress.com/about/ Firefox Currency Converter - ViewMyCurrency]


<p>Note: the [http://viewmycurrency.backpackit.com/pub/403081 current bug list] illustrates some problems of identifying currencies based on page content alone:</p>
=== CBCNews ===
<blockquote>
[http://www.cbc.ca/money/story/2005/08/08/oil-050808.html CBCNews].
<ul>
<li>All $ symbols are treated as USD Very annoying if you are Australian, Canadian etc. (Needs a new feature)</li>
<li>‘Euro 2006 Championship’ should not be converted.</li>
<li>...</li>
<li>Don’t convert CVS keywords . $Revision: 1.3 $ should not be treated as dollars.</li>
</ul>
</blockquote>


===Greasemonkey Scripts ===
<pre>$63.94 US per barrel, up $1.63 US</pre>
[http://nybblelabs.org.uk/projects/exchequer Exchequer]


[http://6v8.gamboni.org/Greasemonkey-Yahoo-Finance.html Yahoo! Finance Currency Converter]
=== Google Finance ===
[http://finance.google.com/finance?q=google&hl=en Google Finance].


===Relevant Standards ===
The current price of a stock:
[http://www.xe.com/iso4217.htm ISO 4217 Codes]


== Brainstorming ==
<pre><span class="pr">401.90</span></pre>
===Ben Buchanan===
<p>Verbose but extensible and explicitly defines all values (without breaking DRY):</p>


<pre><div class="currency">
=== eBay ===
  <p class="figure">
[http://www.ebay.com eBay].
    <span class="code">code</span>
    <span class="sign">symbol</span>
    <span class="amount">12345</span>
  </p>
</div></pre>
<p>&quot;figure&quot; 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.</p>


<p>Without figure:</p>
eBay marks prices as "ebcPr". eBay c? Price.
<pre><div class="currency">
    <span class="code">code</span>
    <span class="sign">symbol</span>
    <span class="amount">12345</span>
</div></pre>


<p>Super shortened, relying on the parser to identify everything via implied order/structure.</p>
<pre>
<td class="ebcPr"><span class="bold">$11.70</span><br/><span>$12.95</span><br/></td>
</pre>


<pre><div class="currency">ABC12345$</div></pre>
=== Google Web Authoring Statistics ===
[http://code.google.com/webstats/2005-12/classes.html Google Web Authoring Statistics] - indirect example.


<p>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.</p>
The Google Web Authoring Statistics mentions that "price" is the 40th most used class name.


<p>Super shortened, but specifying a currency code as a class:</p>
Something like:


<pre><div class="currency ABC">12345$</div></pre>
<pre>
<span class="price">$39.99</span>
</pre>


<p>It defines...</p>
=== McAfee ===
[http://us.mcafee.com/root/package.asp?pkgid=100 McAfee].


<ol type="a">
<pre>
  <li>we're talking about money - ISO standard implied,</li>
<span class="price">$39.99 <span class="currency">(USD)</span></span>
  <li>we're talking about the USD variety,</li>
</pre>
  <li>we're talking fifty units of that money,</li>
  <li>a parser could work out the numbers and the symbol.</li>
</ol>


<p>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.</p>
=== Amazon Product listing ===
[http://www.amazon.com/gp/product/0764597582 Amazon Product listing].


<p>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:</p>
<pre><td class="price">$34.85</td></pre>


<pre><div class="currency">
=== Bell Canada in French Canadian ===
  <span class="code">ABC</span>12345$</p>
[https://secure.vmp.com/signup/adv_signup.php?locale=fr_CA Bell Canada in French Canadian].
</div></pre>


===Charles Iliya Krempeaux===
<pre><b>Niveau de service Premium - 125 $*</b></pre>
<p>Maybe something like...</p>


<pre>Pay me <abbr class="currency" title="CAD">$</abbr>5.00 now!</pre>
Note the placement of the dollar sign AFTER the number.


<p>Although something like the the following might be better...</p>
=== Bell Canada in US English ===
[https://secure.vmp.com/signup/adv_signup.php?locale=en_US Bell Canada in US English].


<pre>Pay me <span class="money"><abbr class="currency" title="CAD">$</abbr>5.00</span> now!</pre>
<pre><b>Premium Service Level - $125*</b></pre>


<p>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.</p>
===Historic prices===
*West Midland Bird Club:
**[http://www.westmidlandbirdclub.com/biblio/worcs.htm#MalvernHand West Midland Bird Club Bibliography] (Published prices of old books)
**[http://www.westmidlandbirdclub.com/reviews/rarer.htm West Midland Bird Club CD-ROM review] (price at time of review; since reduced)
**[http://www.westmidlandbirdclub.com/archive/jubilee-54.htm Silver Jubilee] (1954) - prices in text ("'''five shilling subscriptions'''", "'''10/-'''") shown in footnotes as "'''1 shilling = 5p'''" and "'''10/- = 10 shillings (50p)'''" respectively.
*[http://en.wikipedia.org/wiki/Bleak_House#Original_publication Wikipedia: Bleak House]
**"Like most Dickens novels, Bleak House was published in 19 monthly instalments, each containing 32 pages of text and two illustrations by Phiz. Each cost one shilling, except for the last, which was a double issue and cost two." Dates in the subsequent table range monthly from March 1852 - September 1853
*[http://en.wikipedia.org/wiki/1922_in_Germany#Inflation_and_Repercussions Wikpedia: 1922 in Germany]
**"Despite the ending of cash payments for the rest of 1922, the main cause of Germany's inability to pay, the steady depreciation of the mark, was ongoing. Towards the end of the year it assumed a disastrous rapidity. On August 1, the US Dollar still stood at 643 Marks to the Dollar and the British Pound at 2,850 Marks to the Pound. But on September 5 the dollar had already risen to 1,440 Marks and the pound to 6,525 Marks, and in December the pound was worth between 30,000 and 40,000 marks and the dollar between 7,000 and 9,000."
*[http://news.bbc.co.uk/1/hi/business/1096916.stm BBC News story dated 2 January, 2001]
**"A barrel of Brent crude for February delivery came within range of $25 a barrel on Tuesday before slipping to $24.35, a closing price 48 cents above Friday's closing price of $23.87. In New York, the price of Nymex (New York Merchantile Exchange) crude reached $27.40 a barrel before settling at $27.40, a gain of 41 cents or 1.5% on the day. Nymex oil prices in 2000 averaged $30.20 a barrel, the highest level since 1983, and well above the 1999 average of $19.25. Traders also saw support for the oil price from the Opec basket of seven crude oils which stood at $21.75 a barrell on 29 December 2000. That was the seventh day the price stayed below a preferred range of $22-$28 a barrell. Under an Opec price stability measure, output will be cut by 500,000 barrels a day if the basket price stay below $22 for more than 10 days."
*[http://news.bbc.co.uk/1/hi/uk/911569.stm BBC News story dated 5 September, 2000]
**"The Millennium Commission's decision to grant an extra £47m to the Dome has been widely condemned by MPs on various political hues."
*[http://www.jamaica-gleaner.com/pages/history/story0014.html Jamaica and the Great War]
**"in 1917 [...] unemployment was high and wages were low - men received 9 pence a day to cut cane."
*[http://www.wilkiecollins.demon.co.uk/coinage/coins.htm Money and Coinage in Victorian Britain]
*[http://www.margaretmorgan.com/wesley/state.html Macaulay on the State of England in 1685]
**"In 1661 the justices at Chelmsford had fixed the wages of the Essex labourer, who was not boarded, at six shillings in winter and seven in summer."
*[http://www.bbc.co.uk/ww2peopleswar/stories/74/a4095074.shtml BBC - WW2 People's War]
**"I left [school] at Easter 1938. As soon as I had left school, my Father insisted that I went to work for my Uncle. My wages were 5 shillings per week plus board & lodgings"
*[http://privatewww.essex.ac.uk/~alan/family/N-Money.html Relative Value of Sums of Money]
*[http://eh.net/hmit/ How Much Is That?] (set of calculators)


=== Ben Ward ===
== Existing Practices ==
<p>Could pure HTML be sufficient?</p>
* ... ?
<pre><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>
</html></pre>


===Arve Bersvendsen ===
===Firefox Extension===
<pre><p lang="nb">Den kanadiske prisen på t-skjorten var <span class="currency CAD">34 $</span>.</p></pre>
[http://viewmycurrency.wordpress.com/about/ Firefox Currency Converter - ViewMyCurrency]


=== Mike Stickel ===
<p>Note: the [http://viewmycurrency.backpackit.com/pub/403081 current bug list] illustrates some problems of identifying currencies based on page content alone:</p>
<pre><span class="money"><abbr class="currency" title="CAD eng">$</abbr><span class="amount">5.00</span></span></pre>
<blockquote>
<p>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. 
<ul>
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". 
<li>All $ symbols are treated as USD Very annoying if you are Australian, Canadian etc. (Needs a new feature)</li>
It could also give sites that list multiple languages a way to differentiate when they show multiple prices.</p>
<li>‘Euro 2006 Championship’ should not be converted.</li>
<li>...</li>
<li>Don’t convert CVS keywords . $Revision: 1.3 $ should not be treated as dollars.</li>
</ul>
</blockquote>


=== Ciaran McNulty ===
===Greasemonkey Scripts ===
<p>The only microformat that I've noticed currency units in is [[hListing]], and that deliberately shies away from parsing the actual values because it's too free-form in most existing Listing formats.</p>
[http://nybblelabs.org.uk/projects/exchequer Exchequer]


<p>My own preference would be for something like:</p>
[http://6v8.gamboni.org/Greasemonkey-Yahoo-Finance.html Yahoo! Finance Currency Converter]
<pre><p class="money">This item costs
  <span class="currency">GBP</span>
  <span class="amount">10.00</span>
</p></pre>


<p>Which with similar parsing rules to existing formats would also allow things like:</p>
==See also==
<pre><p class="money">
*[http://code.google.com/webstats/2005-12/classes.html Google code - classes] - discussion of <code>class="price"</code> (the 40th most used class on the web) and the case for attributes for unambiguous specification of currency (see final paragraph).
  It'll cost you
*[http://fx.sauder.ubc.ca/plot.html PACIFIC Exchange Rate Service] - dynamic tables of historic currency conversion rates
  <abbr class="currency" title="50.00">fifty</abbr>
  <abbr class="amount" title="GBP">quid</abbr>
  , mate!
</p></pre>
<p>Or, a more complex example with multiple languages:</p>
<pre>
<p lang="en">Price:
<span class="money">
  <abbr class="currency" title="GBP">&pound;</abbr> 
  <span class="amount">1,250.00</span>
</span>
<span lang="fr" class="money">
  (Prix:
  <span class="amount">1600,00</span>
  <abbr class="currency" title="EUR">&euro;</abbr>
  )
</span>
</p></pre>


== See Also ==
==Related pages==
{{currency-related-pages}}
* [[abbr-design-pattern]]
* [[abbr-design-pattern]]

Latest revision as of 16:21, 18 July 2020

The following are real-world examples of pages that have amounts of money that could be marked up with a currency microformat. As part of the microformats process:

Real-World Examples

Links to public web pages, either popular or insightful

Google Financials

Use of currency amounts in tables.

Representing currency amounts in a table format is very common. For instance, see Google Financials.

In this table representation, it does not make sense to provide the currency information for each cell. Instead, it should be provided once at the table, thead, tr, or th, level, and then a td may override the default value. This is very similar to the common practice of indicating the currency and formatting in plain english: "Numbers in thousands of dollars" in the table title/subtitle or legend.

The microformat for currency amounts should provide a way to represent a default currency for all children of a table, thead, tr, or th nodes. The currency symbol/abbreviation should be optional in for elements defined as containing currency values/amounts, if a default currency has been defined in one of the ancestor elements.

UK Government Data Standards Catalogue

UK Government Data Standards Catalogue

The associated XML Schema seems to suggest an Amount element, followed by a fixed Currency element of "GBP".

SkypeOut Pricing

SkypeOut Pricing.

2.1 US cents/2.4 CAN cents per minute

(on the Web page)

¢2.1 USD (or ¢2.4 CAD) per minute.

(in the announcement email)

See also measure

MIT Enterprise Forum

MIT Enterprise Forum .

$1 million in equity
$2.50 a share

See also measure

Energy Information Administration

Energy Information Administration.

23 cents per barrel

Also in this page:

(U.S. Cents per Gallon)
(Euros per Thousand Liters)
(U.S. Dollars per Gallon)

See also measure

CBCNews

CBCNews.

$63.94 US per barrel, up $1.63 US

Google Finance

Google Finance.

The current price of a stock:

<span class="pr">401.90</span>

eBay

eBay.

eBay marks prices as "ebcPr". eBay c? Price.

<td class="ebcPr"><span class="bold">$11.70</span><br/><span>$12.95</span><br/></td>

Google Web Authoring Statistics

Google Web Authoring Statistics - indirect example.

The Google Web Authoring Statistics mentions that "price" is the 40th most used class name.

Something like:

<span class="price">$39.99</span>

McAfee

McAfee.

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

Amazon Product listing

Amazon Product listing.

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

Bell Canada in French Canadian

Bell Canada in French Canadian.

<b>Niveau de service Premium - 125 $*</b>

Note the placement of the dollar sign AFTER the number.

Bell Canada in US English

Bell Canada in US English.

<b>Premium Service Level - $125*</b>

Historic prices

  • West Midland Bird Club:
  • Wikipedia: Bleak House
    • "Like most Dickens novels, Bleak House was published in 19 monthly instalments, each containing 32 pages of text and two illustrations by Phiz. Each cost one shilling, except for the last, which was a double issue and cost two." Dates in the subsequent table range monthly from March 1852 - September 1853
  • Wikpedia: 1922 in Germany
    • "Despite the ending of cash payments for the rest of 1922, the main cause of Germany's inability to pay, the steady depreciation of the mark, was ongoing. Towards the end of the year it assumed a disastrous rapidity. On August 1, the US Dollar still stood at 643 Marks to the Dollar and the British Pound at 2,850 Marks to the Pound. But on September 5 the dollar had already risen to 1,440 Marks and the pound to 6,525 Marks, and in December the pound was worth between 30,000 and 40,000 marks and the dollar between 7,000 and 9,000."
  • BBC News story dated 2 January, 2001
    • "A barrel of Brent crude for February delivery came within range of $25 a barrel on Tuesday before slipping to $24.35, a closing price 48 cents above Friday's closing price of $23.87. In New York, the price of Nymex (New York Merchantile Exchange) crude reached $27.40 a barrel before settling at $27.40, a gain of 41 cents or 1.5% on the day. Nymex oil prices in 2000 averaged $30.20 a barrel, the highest level since 1983, and well above the 1999 average of $19.25. Traders also saw support for the oil price from the Opec basket of seven crude oils which stood at $21.75 a barrell on 29 December 2000. That was the seventh day the price stayed below a preferred range of $22-$28 a barrell. Under an Opec price stability measure, output will be cut by 500,000 barrels a day if the basket price stay below $22 for more than 10 days."
  • BBC News story dated 5 September, 2000
    • "The Millennium Commission's decision to grant an extra £47m to the Dome has been widely condemned by MPs on various political hues."
  • Jamaica and the Great War
    • "in 1917 [...] unemployment was high and wages were low - men received 9 pence a day to cut cane."
  • Money and Coinage in Victorian Britain
  • Macaulay on the State of England in 1685
    • "In 1661 the justices at Chelmsford had fixed the wages of the Essex labourer, who was not boarded, at six shillings in winter and seven in summer."
  • BBC - WW2 People's War
    • "I left [school] at Easter 1938. As soon as I had left school, my Father insisted that I went to work for my Uncle. My wages were 5 shillings per week plus board & lodgings"
  • Relative Value of Sums of Money
  • How Much Is That? (set of calculators)

Existing Practices

  • ... ?

Firefox Extension

Firefox Currency Converter - ViewMyCurrency

Note: the current bug list illustrates some problems of identifying currencies based on page content alone:

  • All $ symbols are treated as USD Very annoying if you are Australian, Canadian etc. (Needs a new feature)
  • ‘Euro 2006 Championship’ should not be converted.
  • ...
  • Don’t convert CVS keywords . $Revision: 1.3 $ should not be treated as dollars.

Greasemonkey Scripts

Exchequer

Yahoo! Finance Currency Converter

See also

  • Google code - classes - discussion of class="price" (the 40th most used class on the web) and the case for attributes for unambiguous specification of currency (see final paragraph).
  • PACIFIC Exchange Rate Service - dynamic tables of historic currency conversion rates

Related pages