Template:Century name from decade or year/doc

When supplied with a 1-, 2-, 3- or 4-digit year or decade, returns the name of the century.

Mostly used in categorisation.

Parameters

 * 1) The first parameter is required: either a 1-, 2-, 3-, or 4-digit year (e.g. 61, 905, 1839) or a 2-, 3-, or 4--digit decade (e.g. 60s, 900s, 1830s)
 * 2) The second parameter is optional. The single word "dash" changes the output from "nth century" to "nth-century"
 * 3) An optional "nomatch" parameter may be used to specify text to be return if the input cannot be processed.  Default behaviour is return an empty string if there is no match

Errors
Empty or inappropriate parameters produce no output, unless the "nomatch" paremeter is set.

With "nomatch"

TemplateData
{	"params": { "1": {			"label": "Year or decade", "description": "a 1-, 2-, 3- or 4-digit-year (e.g. '1957') or a 4-digit-decade (e.g. '1760s') ", "type": "number", "default": "" },		"2": {			"label": "dash", "description": "If this parameter is dash, then the century number is followed by a dash rather than a space, i.e. '16th-century' instead of the default '16th century'", "type": "string", "default": "" },		"nomatch": { "label": "No match text", "description": "If the input is not a 1-, 2-, 3- or 4-digit year or decade, output the \"nomatch\" value. Defaults to blank.", "type": "string" }	},	"description": "Returns the name of the century for a 1-, 2-, 3- or 4-digit year or decade." }