Webtags/Parameters (preserving history): Difference between revisions
From Cumulus Wiki
Jump to navigationJump to search
m (→Output Modification Parameter for Removing Commas: add dates beside release references) |
m (→Two Output (format modifier) parameters for decimal places: Make consistent - specify release validity first) |
||
Line 145: | Line 145: | ||
'''Why would you want to remove decimal commas?''' Well because the JavaScript language cannot understand decimal commas, and MX has several scripts written in this language, equally some third party alternative web pages rely on ajax to update them (and Ajax uses JavaScript). | '''Why would you want to remove decimal commas?''' Well because the JavaScript language cannot understand decimal commas, and MX has several scripts written in this language, equally some third party alternative web pages rely on ajax to update them (and Ajax uses JavaScript). | ||
==Two | ==Two Output (format modifier) parameters for decimal places == | ||
This functionality was trialled in the original Cumulus, but has been properly implemented in MX. | |||
# | |||
#MX when it came out of beta added usage in the moon tags <#MoonPercent> and <#MoonPercentAbs>). Specifically, <#MoonAge> gives "11" but <#MoonAge dp=3> gives "11.234" | From release 3.10.5 (which did a big rewrite of web tag handling), you can modify the way real numbers (with integer and decimal parts) are output using output modification parameters in either of the following formats: | ||
* <tt><#tag_name dp=i></tt> and | |||
*<tt><#tag_name tc=y></tt> | |||
These can be applied to any tag names that represent real numbers (with integer and decimal parts). | |||
If you are using an early release of MX: | |||
#From beta releases (3.0.0) onwards, <tt><#latitude dp=i></tt> and <tt><#longitude dp=i></tt> were able to be output with "i" decimal places | |||
#*But this output modification parameter could not be applied to any other tags in the MX beta. | |||
#MX when it came out of beta, added this output modification parameter usage in the moon tags <#MoonPercent> and <#MoonPercentAbs>). | |||
#*Specifically, <#MoonAge> gives "11" but <#MoonAge dp=3> gives "11.234" | |||
#In later releases of MX, any tag that gives a decimal output, can use the "dp=n" modifier. | #In later releases of MX, any tag that gives a decimal output, can use the "dp=n" modifier. | ||
If you are using the legacy | If you are using the legacy Cumulus (1.9.4), only <tt><#latitude dp=i></tt> and <tt><#longitude dp=i></tt> were able to be output with "i" decimal places, e.g. <#latitude dp=5> gives "59.24250". | ||
===Controlling the number of decimal places=== | ===Controlling the number of decimal places=== | ||
Line 172: | Line 181: | ||
**If you are using an early release of MX, you will need to research whether this is available for particular web tag names | **If you are using an early release of MX, you will need to research whether this is available for particular web tag names | ||
**Later releases of MX implement this for any tag that by default outputs decimal places. | **Later releases of MX implement this for any tag that by default outputs decimal places. | ||
== Multiple Output Format Modifier parameters for times and dates == | == Multiple Output Format Modifier parameters for times and dates == |