Template talk:Ordinal
This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||
|
|
|
This page has archives. Sections older than 90 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
Equal 1st?
editHI 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)
- @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)
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
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)
- 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)
- WP:RFPP submitted. Cabayi (talk) 13:56, 21 December 2017 (UTC)
- Protection is now in place, looks good-to-go to me. @Abjiklam: -- Cabayi (talk) 15:27, 21 December 2017 (UTC)
- @Cabayi: Thank you. It's now live. Abjiklam (talk) 15:32, 21 December 2017 (UTC)
- Protection is now in place, looks good-to-go to me. @Abjiklam: -- Cabayi (talk) 15:27, 21 December 2017 (UTC)
- WP:RFPP submitted. Cabayi (talk) 13:56, 21 December 2017 (UTC)
Substitution
editThis edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
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)
- @GoldRingChip: I'm looking into your issue. ∰Bellezzasolo✡ Discuss 15:47, 24 February 2018 (UTC)
- 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)
- OK, yeah. It should turn into
I've reopened the TPER with a fix at the sandbox. ∰Bellezzasolo✡ Discuss 15:56, 24 February 2018 (UTC)
- Thanks for replying. I don't know what the TPER is. I use a specially-made template, User:GoldRingChip/SenateSpecialElections, for when I'm trying to insert consistent information in many articles. I only substitute it, however, and that's what causes the problem here. Maybe I made a mistake in my own coding??—GoldRingChip 20:22, 24 February 2018 (UTC)
- Fixed with this edit. — JJMC89 (T·C) 21:32, 24 February 2018 (UTC)
Handling inputs that are already ordinals
editI'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)
- Noting that a current workaround is to use
{{ordinal|{{cardinal|#}}}}
. {{u|Sdkb}} talk 22:18, 24 January 2022 (UTC) - Also noting that text inputs, e.g.
second
, have the same issue. {{u|Sdkb}} talk 22:22, 24 January 2022 (UTC)