الگو:Convert/and

از ویکی‌پدیا، دانشنامهٔ آزاد

{{convert/{{{۴}}}|{{{۱}}}|and|{{{۳}}}|{{{۵}}}|||s=(۰٫۵)+(۰{{{s}}})|r={{{r}}}|d=Dual/{{{d}}}}}


The الگو:Convert/and (for ranges using "and") is invoked as the first template below {Convert}, for converting ranges such as {Convert|2|and|4|ft|m}. It immediately invokes Convert/{4}, for the input unit {4}, passing the range of input numbers as "{1}|and|{3}". Having obtained all 8 parameters, {1}|and|{3}...{8}, it sets the precision "s" from either parameter {5}, {6} or {8} (depending on whichever is the numeric round-number); otherwise, the precision is set as: s=(0.5)+(0{{{s}}}). It passes {d} down as Dual/{d} to invoke subtemplate Convert/Dual/{d} which displays the dual-range (rather than a typical single amount). For any customization، such as disp=x، the parameters {۶} and {۷} are passed as {۵} and {۶} (or null if none).