Template:Place

From comp.tf
Revision as of 09:37, 20 April 2020 by Garlic (talk | contribs)
Jump to navigation Jump to search

(view - edit) Documentation

Template:Place returns a given number as a placing with the appropriate suffix.

Usage

You type You get
{{place|1}} {{#switch:1 11 12 1th #default={{#switch:1 1st 1nd 3 =
  1. default=
{{place|22}} {{#switch:22 11 12 22th #default={{#switch:2 22st 22nd 3 =
  1. default=
{{place|33}} {{#switch:33 11 12 33th #default={{#switch:3 33st 33nd 3 =
  1. default=
{{place|111}} {{#switch:11 11 12 111th #default={{#switch:1 111st 111nd 3 =
  1. default=

Optional parameters

|sup=
  • If set to 1, the template will return the suffix as subscript.
    • e.g. {{place|5|sup=1}} returns {{#switch:5
| 11 
| 12 
| 13 = {{#if:|5th
|#default={{#switch:5
| 1 = {{#if:|5st
| 2 = {{#if:|5nd
| 3 = 
  1. default=
|sep=
  • If set to a symbol, the template will use it as a thousands separator.
    • e.g. {{place|1000|sep=,}} returns {{#switch:00
| 11 
| 12 
| 13 = {{#if:,|1,000th
|#default={{#switch:0
| 1 = {{#if:,|1,000st
| 2 = {{#if:,|1,000nd
| 3 = 1,000rd