Webtags/Parameters: Difference between revisions

472 bytes removed ,  12:10, 2 October 2022
m
Line 95: Line 95:
# The majority of tag names have a default output if there is no output format modifier, but accept either one or two output format parameters, allowing you to change what they output.
# The majority of tag names have a default output if there is no output format modifier, but accept either one or two output format parameters, allowing you to change what they output.


=Documentation for Output modification parameters=
== Description of Output modification parameters ==
The output format for numbers and dates is ruled by the international settings (Windows) or locale settings (Linux). These settings are hereafter named the locale or locale settings. So if you want to have other formats for numbers and dates than you are seeing in your website or your reports, than your first step should be to check and possibly reconsider your locale. Beside that you must know that javascript does not handle a comma as decimal seperator. So if you wish to see a comma as decimal separator you probably must take some special precautions.


Use the links above to skip to the particular parameters that you wish to use.
=== Changing the decimal separator ===


==Output Modification Parameter for changing any decimal comma into a decimal point==
CumulusMX never uses a comma for separating off thousands, and there is no way to make it output numbers above 999 with a space or comma to separate out thousands.


Note that Cumulus software never uses a comma for separating off thousands, and there is no way to make it output numbers above 999 with a space or comma to separate out thousands.
If the tag name represents a real number with integer and decimal parts, then Cumulus by default will output that number using whatever your locale defines as the separator character (decimal comma or decimal point).  The legacy Cumulus 1 provided a few derivatives where a prefix of "RC" before tag name as in <code><#RCtag_name></code> could force the output to use a decimal point (regardless of locale), that option remains available in CumulusMX for backward compatibility.


If the tag name represents a real number with integer and decimal parts, then Cumulus by default will output that number using whatever your locale defines as the separator character (decimal comma or decimal point).  The legacy Cumulus 1 provided a few derivatives where a prefix of "RC" before tag name as in <code><#RCtag_name></code> could force the output to use a decimal point (regardless of locale), that option remains available in MX for forward compatibility.
The current possibilities are:
 
In Cumulus MX (only), you can alternatively use an output modification parameter in format <tt><#tag_name rc=y></tt> to select whether the output should use decimal comma or decimal point:
*From beta release 3.0.0,  build 3047 (3 February 2019), up to and including release 3.5.3, only implemented on a few new web tags (#MoonPercent, #MoonPercentAbs, #MoonAge)
*From release 3.6.6 onwards (1 June 2020), it was extended to other web tags that output real numbers.
*From release 3.10.5 onwards (29 March 2021), the use of <tt><#tag_name rc=n></tt> became also possible, to ensure decimal comma shown when locale specifies it
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 127: Line 123:




'''Why would you want to remove decimal commas?'''  Well because the JavaScript language (and some other languages) 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).
=== Controlling the number of decimal places ===
 
==Controlling the number of decimal places==


If the tag name represents a real number (with both integer and decimal parts) then there are a number of ways to control the number of decimal places:
If the tag name represents a real number (with both integer and decimal parts) then there are a number of ways to control the number of decimal places: