User:QuickNick/FormatNumDP3

Script to nicely format and round numbers to N decimal places.

Note: This is functionally the same as User:QuickNick/FormatNumDP2 but it is assumed that the first/only (unnamed) parameter will be the number to be output.

Syntax:

DP is Number of Decimal Places and if not set it will default to 0.

This is the relevant part of the script with carriage-returns to make it easier to read!

Some examples ...

100kph = mph 100kph = mph The number can be (un)formatted so

is the same as

The number can be (un)formatted so is the same as