Template:FloorNumber

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to: navigation, search

ground floor[UK]1st floor[US]

Template documentation
This documentation is transcluded from Template:FloorNumber/doc. [edit] [purge]
Template:FloorNumber invokes function main in Module:FloorNumber using Lua.

The FloorNumber template outputs a textual floor reference, using the recommended British style; it takes an input in American style numbering. A note is also provided to explain the floor reference to the reader.

Usage

Basic usage

{{FloorNumber|US floor}}
{{FloorNumber|us=US floor}}
{{FloorNumber|uk=UK floor}}

Any one of the methods above can be used, where the floor is provided as an integer greater than 0 (or greater than or equal to 0 for UK floors). Either the first unnamed parameter or the us parameter will define the floor using the convention used by USA/Canada ('American style'). The uk parameter defines the floor using the convention used by UK/Europe/most Commonwealth contries ('British style'). If multiple of these are defined, FloorNumber will use them in this order: uk, us, 1 (first unnamed parameter), then default to ground floor/US first floor.

American style floors define the entrance (that is level with the outside ground) as the 1st floor (use ground floor[UK]1st floor[US] or ground floor[UK]1st floor[US]), with floors incrementing above that (climbing one set of stairs puts you on the 2nd floor, then the 3rd floor, etc.).

British style floors define the entrance (that is level with the outside ground) as the ground floor (use ground floor[UK]1st floor[US]), with floors incrementing above that (climbing one set of stairs puts you on the 1st floor, then the 2nd floor, etc.).

Optional other parameters

{{FloorNumber|us=1|caps=y|nohelp=y}}
{{FloorNumber|1|caps|nohelp}}

If caps=y, or the second unnamed parameter is set to 'caps', and if the floor is the ground floor, it will be capitalised as "Ground floor". No effect for other floors.

If nohelp=y, or the third unnamed parameter is set to 'nohelp', the tooltip is suppressed.

Auto-switching

This template uses code present in MediaWiki:Gadget-skinTogglesNew.js to automatically switch between British and American styles. By default this is done by detecting the user's browser locale - if it is one of en-US en-CA es-US fr-CA it uses American style, and British style otherwise. This can be overridden by the user in the skin toggles window (moon at the top of the window, with dark mode toggles).

It can also be overridden on a per-usage basis by using floornumber-override-gb or floornumber-override-us.

Examples

Examples in context, as template inputs and outputs, are below:

Template Result (UK) Result (US)
{{FloorNumber|1}} ground floor[UK]1st floor[US] ground floor[UK]1st floor[US]
{{FloorNumber|uk=1}} 1st floor[UK]2nd floor[US] 1st floor[UK]2nd floor[US]
{{FloorNumber|us=2}} 1st floor[UK]2nd floor[US] 1st floor[UK]2nd floor[US]
{{FloorNumber|3}} 2nd floor[UK]3rd floor[US] 2nd floor[UK]3rd floor[US]
{{FloorNumber|1|caps|nohelp}} Ground floor1st floor Ground floor1st floor
{{FloorNumber|22|nohelp=y}} 21st floor22nd floor 21st floor22nd floor
{{FloorNumber|1|caps=y}} Ground floor[UK]1st floor[US] Ground floor[UK]1st floor[US]

Notes

This template does not yet support basements, i.e. US floors 0 and below, nor successive basements below those. The reason for this adjustment is that British floor numbering counts from zero on the ground floor. The American (US) system starts from one. The adjustment of -1 (ie, US n + -1 = UK n) ensures they start at the same place.

Template data

Show/hide template's data

The following information is used by extensions and applications, such as VisualEditor, to help users implement this template onto pages. Please ensure that it is up-to-date.

Outputs a textual floor reference, using the recommended [[RuneScape:Style guide#Floor numbering|British style]]; it takes an input in American style numbering. A note is also provided to explain the floor reference to the reader.

Template parameters

This template has custom formatting.

ParameterDescriptionTypeStatus
Floor number (US)1us

The number of the floor using the American numbering system i.e. ground floor = 1. At least one of us or uk number must be defined.

Default
empty
Example
2
Auto value
empty
Numberoptional
Floor number (UK)uk

The number of the floor using the British numbering system i.e. ground floor = 0. At least one of us or uk number must be defined.

Default
empty
Example
1
Auto value
empty
Unknownoptional
capscaps

Capitalises the first letter

Default
empty
Example
y
Auto value
y
Booleanoptional
nohelpnohelp

Suppresses help tooltip

Default
empty
Example
y
Auto value
y
Booleanoptional
nohelp (deprecated)2

Deprecated nohelp. Set to nohelp to suppress help tooltip.

Default
empty
Example
nohelp
Auto value
nohelp
Stringdeprecated
caps (deprecated)3

Deprecated caps. Set to caps to use Ground instead of ground.

Default
empty
Example
caps
Auto value
caps
Unknowndeprecated