[uf-new] Currency brainstorming

Andy Mabbett andy at pigsonthewing.org.uk
Sat Sep 29 11:05:03 PDT 2007


In message <615160.30567.qm at web54108.mail.re2.yahoo.com>, Taylor Cowan
<taylor_cowan at yahoo.com> writes

>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?

That's certainly what I want; and to be able to include dates).

>"one hundred bucks"
><abbr class="currency" title="USD100">one hundred bucks</abbr>
>
>$100 (CAD)
><abbr class="currency" title="CAD100">$100</abbr>
>
>10 cents
><abbr class="currency" title="USD0.10">ten cents</abbr>

Occam's Razor! That's really good - no, superb! - thinking.

It even works for pre-decimal coinage:

        <abbr class="currency title="GBP0.125">
          two shillings and sixpence
        </abbr>

        <abbr class="currency title="GBP1.05">One guinea</abbr>

The only snag is the perennial abbr-accessibly issue, but if that's
found to apply here, your examples would work just as well as:

        <span class="currency title-trigger" title="USD100">one hundred
        bucks</span>

        <span class="currency title-trigger" title="CAD100">$100</span>

        <span class="currency title-trigger" title="USD0.10">ten
        cents</span>

or whatever the eventual solution is.


To apply a date, we could simply use hCalendar:

    <div class="vevent">
      <span class="description">
        <span class="summary">
          The last Monet painting to be auctioned
        </span>
        fetched
        <abbr class="currency" title="USD95M">$95 million</abbr>
        in
        <span class="dtstart>2005</span>
      </span>
    </div>

(or whatever way we decide to encode millions, etc.). After all, if you
remove the currency mark-up, that's what someone could publish already.


Also, in cases where no suitable textual summary is available):

    <div class="vevent">
        <span class="summary">
                <abbr class="currency" title="USD95M">$95 million</abbr>
                (<span class="dtstart>2005</span>)
        </span>
    </div>

Neither requires any extra microformat attributes; just a note to
parsers that they SHOULD consider any currency within an hCalendar to
have allied at that date.


OTOH, if that is thought to cause backwards-compatibility issues, then
an extra class:

    <div class="vevent">
        <span class="summary">
                <abbr class="currency dated" title="USD95M">$95
                million</abbr>
                (<span class="dtstart>2005</span>)
        </span>
    </div>

could indicate to a parser that the currency (or any other microformat
created in future) is qualified by the surrounding hCalendar.


I wonder if Taylor's elegant solution can also be applied to
measurements? I#ll post in that thread.

-- 
Andy Mabbett


More information about the microformats-new mailing list