Module talk:Sandbox/RexxS/Units

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

@RexxS: I suspect that convertcode is the only thing we need in this table, as {{convert}} will provide the rest. — Martin (MSGJ · talk) 12:34, 27 April 2016 (UTC)[reply]

Yes, of course, Martin, for the present application; I was thinking ahead to other applications where we want to know a unit name from its QID, but don't want to risk looking up a label that anyone can edit on Wikidata. --RexxS (talk) 13:19, 27 April 2016 (UTC)[reply]
No need:
  • {{convert|1|feet|disp=unit}} gives singular: foot
  • {{convert|2|feet|disp=unit}} gives plural: feet
  • {{convert|1|feet|disp=unit|abbr=on}} gives abbreviation: ft
— Martin (MSGJ · talk) 13:31, 27 April 2016 (UTC)[reply]
Sorry I'm not being clear. I was thinking of when other Lua Modules needed to return a vandal-proof unit name or abbreviation from QIDs, perhaps several times. It is far easier to 'require()' a lookup table than to make external calls to a heavyweight module like Module:Convert. Anyway, at present {convert} doesn't accept a QID like "Q253276", although Johnuniq is working on it. --RexxS (talk) 14:32, 27 April 2016 (UTC)[reply]