Template talk:M3 to ft3

From Wikipedia, the free encyclopedia

[edit] Abbreviations?

possible to have "Am" or "Com" as abbreviated forms of the spelling variable? — Timotab Timothy (not Tim dagnabbit!) 15:06, 28 September 2007 (UTC)

Timotab, I think that's a great idea. Does anyone happen to know if there's some kind of "startsWith" function that I can take advantage of? That way, you could use "Am", "Ame", "amer", etc., and I wouldn't have to specifically test for each and every one of those...? --MikeVitale 15:30, 28 September 2007 (UTC)
I don't know of any "startsWith" but there is "switch". You still have to test each one but it's done all together e.g.
  • {{#switch:{{LC:{{{spell}}}}}|commonwealth|cw|com|co|c|bre|cane|nze|ause=metre|meter}} will give metre wherever {{{spell}}} is commonwealth, cw, com, ... BrE, etc. & will give meter otherwise. Jɪmp 14:04, 29 September 2007 (UTC)