User:Johan G/convert/rear

From FlightGear wiki
< User:Johan G‎ | convert
Revision as of 17:40, 6 August 2018 by Johan G (talk | contribs) (Moving pretty much all but the conversion factors here)
Jump to navigation Jump to search

{{User:Johan G/convert/pds}}: Parameter value 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