Skip to content
Sections
Fiesta

Dates, numbers and names

How to show dates, numbers, money, names and addresses, and which ones people mix up.

  • format-datesPut a date in a <time> tag, with a version of the date a computer can read. Write the date itself however your readers expect to see it. Fiesta will not format it for you.
  • format-durationsUse <time> for a length of time too. The computer-readable version looks strange: PT2H30M means 2 hours 30 minutes.
  • format-numbersBreak up long numbers so they can be read at a glance: 54,173 in English, 54.173 in German, ٥٤٬١٧٣ in Arabic. Never show a long number as plain digits. In a table, use digits that are all the same width, so the columns line up.
  • format-moneyStore each amount as a whole number of the currency's smallest unit, such as cents, with its currency code beside it. Write it the way the reader's language does. The currency always comes from your data, never from the reader.
  • format-ratiosUse <meter> to show how full something is. Use <progress> to show how far a job has got. Always print the number beside the bar. A bar on its own tells a blind reader nothing.
  • format-filesizesShow a rounded size like 4 MB, and put the exact number of bytes in a <data> tag. Screen readers read what is on screen and ignore the tag, so the rounded size has to be useful on its own.
  • format-identifiersDo not break these up. Order 4471, not order 4,471. Years, version numbers and port numbers are the same. Use rst-mono so they look like codes, and never put one in a <time> tag, even when it looks like a date.
  • format-peopleA name can be in any language, including ones that read right to left. When a name sits in the middle of a line, wrap it in <bdi>, or it will scramble the words around it. Use person to show a name with a picture beside it.
  • format-addressesThe <address> tag is not for postal addresses. It is for saying who wrote the page. A delivery address is ordinary text. A list of staff is a list.
  • format-abbrThe <abbr> tag shows the full wording when you hover. That does not work on a phone, and screen readers often skip it. Write the words out in full the first time as well.
  • format-outputWhen your page adds something up, put the answer in an <output> tag. A running total, a converted price, a countdown.