Template:Nm to km

From KayakWiki


This is the Nm to km Template.

For more information on templates - see About Templates

This template uses unnamed parameters

This template converts nautical miles (or knots - nautical miles per hour) to kilometers (or kilometers per hour). The parameters include a rounding value to specify how many decimal places are to be used - default is rounded to the nearest unit. This means you can input some text with a distance in nautical miles and have it display converted to kilometers without doing the math yourself.

In order to output the values with reference to speed, the second parameter should be the word speed. Any other value, or a blank, will result in the output being displayed as distance.


For example, entering
Many kayakers are comfortable paddling at {{nm to km|3.5|speed|1}}
results in
Many kayakers are comfortable paddling at 3.5 kt (6.5 kph)
Using the default for number of decimal places
The distance to the point is {{nm to km|3.5}}
results in
The distance to the point is 3.5 nm (6 km)

To output in distance units and specify the number of digits after the decimal point, use either:

  • {{nm to km|6|x|1}} - where x is any text or number
  • {{nm to km|6||1}} - leave the second parameter empty

Copy the template text between the lines below (no need to edit, just mark and copy) and paste it into the edit page. Then fill in the parameters. If a parameter does not apply, you can delete the parameter and its associated pipe (|).

Copy below this line:


{{nm to km|nautical miles|speed or other|number of decimal digits}}


Copy above this line.


[edit] Parameter definitions

Parameter Description Mandatory or Default value
First parameter Distance (speed) in nautical miles (knots) 0
Second parameter
  • speed - text as shown - display output in units of speed.
  • Any other value - display output in units of distance.
output as distance
Third parameter number of digits to the right of the decimal place. 0

The template follows (you won't see the whole thing if null defaults exist in the template):


0 nm (0 km)