Jump to content

Template talk:Ordinal

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
(Redirected from Module talk:Ordinal)

Equal 1st?

[edit]

HI MSGJ, as the last user to make changes to this template, would the code be able to be modified so that {{Ordinal|=1}} could produce =1st. Know how pesky equal signs are in code but it would be great if this could be done. Cheers – Ianblair23 (talk) 07:19, 15 August 2017 (UTC)[reply]

@Ianblair23: Module:Ordinal, which I hope can replace the current template, allows for any arbitrary string to come before the numeral. As long as the last characters of the parameter are digits, the module should give the correct output. For example, {{#invoke:Ordinal|ordinal|{{=}}1}} outputs =1st. Abjiklam (talk) 15:35, 20 December 2017 (UTC)[reply]

I've rewritten this template as a module at Module:Ordinal. I've tested it at Template:Ordinal/sandbox and Template:Ordinal/testcases and it doesn't seem to break, but I would like some input from others before I make any changes to the main template. Can someone confirm that the module doesn't break and can replace the current template? Abjiklam (talk) 15:02, 20 December 2017 (UTC)[reply]

I'd like to see the protection level of the module set to TE (the same level as the template) before going live. Cabayi (talk) 13:49, 21 December 2017 (UTC) ...oh, forgot, no problems spotted with the output. Cabayi (talk) 13:50, 21 December 2017 (UTC)[reply]
WP:RFPP submitted. Cabayi (talk) 13:56, 21 December 2017 (UTC)[reply]
Protection is now in place, looks good-to-go to me. @Abjiklam: -- Cabayi (talk) 15:27, 21 December 2017 (UTC)[reply]
@Cabayi: Thank you. It's now live. Abjiklam (talk) 15:32, 21 December 2017 (UTC)[reply]

Substitution

[edit]

Since rewriting as a Module, the substitution feature doesn't work. I don't know why. Or am I using it incorrectly?

{{subst:Ordinal|13}}
turns into:
{{#invoke:Ordinal|ordinal}}

GoldRingChip 13:12, 6 February 2018 (UTC)[reply]

@GoldRingChip: I'm looking into your issue. Bellezzasolo Discuss 15:47, 24 February 2018 (UTC)[reply]
OK, yeah. It should turn into {{#invoke:Ordinal|ordinal|13}} - which gives 13th, or more generally {{#invoke:Ordinal|ordinal|{{{1}}}}}
The simplest way around this is not to subst, because then the #invoke automatically works it out. I don't know why you want to subst this, but it says that it can be. Bellezzasolo Discuss 15:50, 24 February 2018 (UTC)[reply]

I've reopened the TPER with a fix at the sandbox. Bellezzasolo Discuss 15:56, 24 February 2018 (UTC)[reply]

Handling inputs that are already ordinals

[edit]

I'd like this template to better handle inputs that are already ordinals. For instance, {{Ordinal}} should just spit back out 47th, not 47thth. This would help make templates more flexible in case a user accidentally enters an ordinal when they should've just gone with the numeral. Would anyone be able to help implement that? {{u|Sdkb}}talk 22:14, 24 January 2022 (UTC)[reply]

Noting that a current workaround is to use {{ordinal|{{cardinal|#}}}}. {{u|Sdkb}}talk 22:18, 24 January 2022 (UTC)[reply]
Also noting that text inputs, e.g. second, have the same issue. {{u|Sdkb}}talk 22:22, 24 January 2022 (UTC)[reply]