User:Ohms law/Convert

{{Convert/{{{d}}}And|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|s={{{s|}}}
|U=mi
|N=mile
|T=Mile
|u=ft
|n=foot (unit)
|l=feet
|a=5280<!-- Feet per mile -->
|b=.3048<!-- meters per foot -->
|j=-0.5159850373-{{{j}}}}}</includeonly><noinclude>

Ohms,

It looks pretty good. Here are a couple of things I forgot to mention.

  • u stands for unit symbol/abbreviation
  • n stands for unit name
  • l stands for plural
  • h stands for hyphenated form
  • t stands for article title

I guess you figured most of this out. What you wouldn't have easily guessed is that l, h and t are optional (u is sort of optional but that's another story). There are no hs here, right, that's because these are both one-word unit names (you'd need an h for square feet). Now, the way you've got it here, it's going to link to foot instead of foot (unit). You need a t=foot (unit) but the T=Mile is not necessary nor is L=miles (you only need ls if the plural is "irregular" (where "irregular" includes plurals formed by adding "es" as in "inches"))

You probably also figured out that capitals are for the big units and lower-case are for the small. You've chosen a bit of a tricky one to start with; single units are easier (all lower-case in that case). Also the bs are easier with single units ... for miles & feet is b the number of metres in a mile or in a foot? Also you don't have to worry about as either ... P.S. you got the wrong a for miles and feet, 12 is good for feet and inches ... have you guessed yet? If not, have a look here.

Now to parameter j. It stands for jump ... for want of a better thing to call it ... as in a sort of jump in precision ... sort of how far would you move the decimal point in order to keep the same precision? So j = log10b. If I were creating the template again from scratch, I wouldn't have a j but there was no parser function for logarithms four years ago. One of these days I'd like to get rid of it, it makes it difficult for people to add units.

I'm not quite sure where you got the LoffAoffDbSoff from but it should be {{{d}}}And. These unit templates don't have a pre-determined place to go, you have to tell them where to go, this is how we can use the same one for input and output units, various different display options, in other templates like {{var}} & {{endurance}}, etc. Also don't put the km there, default outputs are given by o but this is an output-only template (if you want the template to accept miles & feet as input we'll have to adjust {{convert/mi}}).

Good luck. JIMp talk·cont 23:59, 21 June 2011 (UTC)

Getting warmer ... n for name, t for title in the case of miles same but not for feet. JIMp talk·cont 00:29, 22 June 2011 (UTC)

Category:Subtemplates of Template Convert

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.