User:Johan G/convert: Difference between revisions

Jump to navigation Jump to search
Fix: Used named template parameters in the template instead of unnamed/numbered parameters. Hence absolutely nothing worked as per documentation
(Created page with "{{#if: <!-- Is the value parameter missing? --> {{{value|}}} | <!-- No, the value parameter is not missing -->{{#switch: {{{from-unit|}}} | mm = {{#switch: {{{to-u...")
 
(Fix: Used named template parameters in the template instead of unnamed/numbered parameters. Hence absolutely nothing worked as per documentation)
Line 1: Line 1:
{{#if: <!-- Is the value parameter missing? -->
{{#if: <!-- Is the value parameter missing? -->
   {{{value|}}}
   {{{1|}}}
   | <!-- No, the value parameter is not missing
   | <!-- No, the value parameter is not missing
     -->{{#switch: {{{from-unit|}}}
     -->{{#switch: {{{2|}}}
     | mm = {{#switch: {{{to-unit|}}}
     | mm = {{#switch: {{{3|}}}
       | in = {{#expr: {{{value|309}}} div 25.4 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||in}}
       | in = {{#expr: {{{value|309}}} div 25.4 round {{{4|0}}}}} {{#if: {{{5|}}}||in}}
       | ft = {{#expr: {{{value}}} div 304.8 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||ft}}
       | ft = {{#expr: {{{1}}} div 304.8 round {{{4|0}}}}} {{#if: {{{5|}}}||ft}}
       | m = {{#expr: {{{value}}} div 1000 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||m}}
       | m = {{#expr: {{{1}}} div 1000 round {{{4|0}}}}} {{#if: {{{5|}}}||m}}
       | km = {{#expr: {{{value}}} div 1000000 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||km}}
       | km = {{#expr: {{{1}}} div 1000000 round {{{4|0}}}}} {{#if: {{{5|}}}||km}}
       | mi = {{#expr: {{{value}}} div 1609300 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||mi}}
       | mi = {{#expr: {{{1}}} div 1609300 round {{{4|0}}}}} {{#if: {{{5|}}}||mi}}
       | NM = {{#expr: {{{value}}} div 1852000 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||NM}}
       | NM = {{#expr: {{{1}}} div 1852000 round {{{4|0}}}}} {{#if: {{{5|}}}||NM}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | in = {{#switch: {{{to-unit|}}}
     | in = {{#switch: {{{3|}}}
       | mm = {{error|Conversion not implemented}}
       | mm = {{error|Conversion not implemented}}
       | ft = {{error|Conversion not implemented}}
       | ft = {{error|Conversion not implemented}}
Line 21: Line 21:
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | ft = {{#switch: {{{to-unit|}}}
     | ft = {{#switch: {{{3|}}}
       | mm = {{error|Conversion not implemented}}
       | mm = {{error|Conversion not implemented}}
       | in = {{error|Conversion not implemented}}
       | in = {{error|Conversion not implemented}}
Line 30: Line 30:
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | m = {{#switch: {{{to-unit|}}}
     | m = {{#switch: {{{3|}}}
       | mm = {{#expr: {{{value}}} div 0.001 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||mm}}
       | mm = {{#expr: {{{1}}} div 0.001 round {{{4|0}}}}} {{#if: {{{5|}}}||mm}}
       | in = {{#expr: {{{value}}} div 0.0254 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||in}}
       | in = {{#expr: {{{1}}} div 0.0254 round {{{4|0}}}}} {{#if: {{{5|}}}||in}}
       | ft = {{#expr: {{{value}}} div 0.3048 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||ft}}
       | ft = {{#expr: {{{1}}} div 0.3048 round {{{4|0}}}}} {{#if: {{{5|}}}||ft}}
       | km = {{#expr: {{{value}}} div 1000 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||km}}
       | km = {{#expr: {{{1}}} div 1000 round {{{4|0}}}}} {{#if: {{{5|}}}||km}}
       | mi = {{#expr: {{{value}}} div 1609.3 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||mi}}
       | mi = {{#expr: {{{1}}} div 1609.3 round {{{4|0}}}}} {{#if: {{{5|}}}||mi}}
       | NM = {{#expr: {{{value}}} div 1852 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||NM}}
       | NM = {{#expr: {{{1}}} div 1852 round {{{4|0}}}}} {{#if: {{{5|}}}||NM}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | km = {{#switch: {{{to-unit|}}}
     | km = {{#switch: {{{3|}}}
       | mm = {{#expr: {{{value}}} div 0.000001 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||mm}}
       | mm = {{#expr: {{{1}}} div 0.000001 round {{{4|0}}}}} {{#if: {{{5|}}}||mm}}
       | in = {{#expr: {{{value}}} div 0.0000254 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||in}}
       | in = {{#expr: {{{1}}} div 0.0000254 round {{{4|0}}}}} {{#if: {{{5|}}}||in}}
       | ft = {{#expr: {{{value}}} div 0.0003048 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||ft}}
       | ft = {{#expr: {{{1}}} div 0.0003048 round {{{4|0}}}}} {{#if: {{{5|}}}||ft}}
       | m = {{#expr: {{{value}}} div 1 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||m}}
       | m = {{#expr: {{{1}}} div 1 round {{{4|0}}}}} {{#if: {{{5|}}}||m}}
       | mi = {{#expr: {{{value}}} div 1.6093 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||mi}}
       | mi = {{#expr: {{{1}}} div 1.6093 round {{{4|0}}}}} {{#if: {{{5|}}}||mi}}
       | NM = {{#expr: {{{value}}} div 1.852 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||NM}}
       | NM = {{#expr: {{{1}}} div 1.852 round {{{4|0}}}}} {{#if: {{{5|}}}||NM}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | mi = {{#switch: {{{to-unit|}}}
     | mi = {{#switch: {{{3|}}}
       | mm = {{error|Conversion not implemented}}
       | mm = {{error|Conversion not implemented}}
       | in = {{error|Conversion not implemented}}
       | in = {{error|Conversion not implemented}}
Line 57: Line 57:
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | NM = {{#switch: {{{to-unit|}}}
     | NM = {{#switch: {{{3|}}}
       | mm = {{error|Conversion not implemented}}
       | mm = {{error|Conversion not implemented}}
       | in = {{error|Conversion not implemented}}
       | in = {{error|Conversion not implemented}}
Line 66: Line 66:
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | ft/s = {{#switch: {{{to-unit|}}}
     | ft/s = {{#switch: {{{3|}}}
       | m/s = {{error|Conversion not implemented}}
       | m/s = {{error|Conversion not implemented}}
       | km/h = {{error|Conversion not implemented}}
       | km/h = {{error|Conversion not implemented}}
Line 73: Line 73:
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | m/s = {{#switch: {{{to-unit|}}}
     | m/s = {{#switch: {{{3|}}}
       | ft/s = {{error|Conversion not implemented}}
       | ft/s = {{error|Conversion not implemented}}
       | km/h = {{error|Conversion not implemented}}
       | km/h = {{error|Conversion not implemented}}
Line 80: Line 80:
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | km/h = {{#switch: {{{to-unit|}}}
     | km/h = {{#switch: {{{3|}}}
       | ft/s = {{error|Conversion not implemented}}
       | ft/s = {{error|Conversion not implemented}}
       | m/s = {{error|Conversion not implemented}}
       | m/s = {{error|Conversion not implemented}}
Line 87: Line 87:
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | mph = {{#switch: {{{to-unit|}}}
     | mph = {{#switch: {{{3|}}}
       | ft/s = {{error|Conversion not implemented}}
       | ft/s = {{error|Conversion not implemented}}
       | m/s = {{error|Conversion not implemented}}
       | m/s = {{error|Conversion not implemented}}
Line 94: Line 94:
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | kt = {{#switch: {{{to-unit|}}}
     | kt = {{#switch: {{{3|}}}
       | ft/s = {{error|Conversion not implemented}}
       | ft/s = {{error|Conversion not implemented}}
       | m/s = {{error|Conversion not implemented}}
       | m/s = {{error|Conversion not implemented}}
Line 101: Line 101:
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | s = {{#switch: {{{to-unit|}}}
     | s = {{#switch: {{{3|}}}
       | min = {{#expr: {{{value}}} div 60 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||min}}
       | min = {{#expr: {{{1}}} div 60 round {{{4|0}}}}} {{#if: {{{5|}}}||min}}
       | h = {{#expr: {{{value}}} div 3600 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||h}}
       | h = {{#expr: {{{1}}} div 3600 round {{{4|0}}}}} {{#if: {{{5|}}}||h}}
       | d = {{#expr: {{{value}}} div 86400 round {{{decimals|0}}}}} {{#if: {{{hide-unit|}}}||d}}
       | d = {{#expr: {{{1}}} div 86400 round {{{4|0}}}}} {{#if: {{{5|}}}||d}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | min = {{#switch: {{{to-unit|}}}
     | min = {{#switch: {{{3|}}}
       | s = {{error|Conversion not implemented}}
       | s = {{error|Conversion not implemented}}
       | h = {{error|Conversion not implemented}}
       | h = {{error|Conversion not implemented}}
Line 113: Line 113:
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | h = {{#switch: {{{to-unit|}}}
     | h = {{#switch: {{{3|}}}
       | s = {{error|Conversion not implemented}}
       | s = {{error|Conversion not implemented}}
       | min = {{error|Conversion not implemented}}
       | min = {{error|Conversion not implemented}}
Line 119: Line 119:
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
       | #default = {{error|Parameter '''to-unit''' missing or not supported}}
     }}
     }}
     | d = {{#switch: {{{to-unit|}}}
     | d = {{#switch: {{{3|}}}
       | s = {{error|Conversion not implemented}}
       | s = {{error|Conversion not implemented}}
       | min = {{error|Conversion not implemented}}
       | min = {{error|Conversion not implemented}}

Navigation menu