Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

User:Johan G/convert/rear

From FlightGear wiki
Jump to: navigation, search

{{User:Johan G/convert/rear}}: Parameter expression missing

The following template description is not displayed when the template is inserted in an article.

Goal

This template handles rounding, decimals and units for User:Johan G/convert ("rear" is for rear part of the quantity).


Note When this template draft is moved to the template namespace, give it a better name...

Usage

{{User:Johan G/convert/rear|expression|to-unit|decimals|hide-unit}}

The parameters expression and to-unit is manatory, though all parameters should be passed from the main template.

expression
Expression to be calculated with Extension:ParserFunctions's #expr function
to-unit
Unit to be converted to
decimals
Number of decimals. If empty, no decimals will be shown
hide-unit
If not empty the unit will not be shown in the result

Examples

Conversion from millimeters to inches as it would be used in the main template...

{{User:Johan G/convert/rear|{{{1}}} div 25.4|in|{{{4|}}}|{{{5|}}}}}

...with the parameters having these values

{{User:Johan G/convert/rear|1000 div 25.4|in|2|}}

39.37 in

Known issues

Trailing zeros in the decimals will not be shown.

Related templates