Webtags/Parameters: Difference between revisions

517 bytes removed ,  12:28, 2 October 2022
m
Line 125: Line 125:


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:
* [[File:Badge v1.png]]Cumulus 1.x.y: <tt>dp=i</tt> rounds output to number of decimal places specified by "i"
* <tt>dp=i</tt> rounds output to number of decimal places specified by "i"
* [[File:Badge vMx.png]] All MX releases:  <tt>dp=i</tt> rounds output to number of decimal places specified by "i"
* <tt>tc=y</tt> truncates output, display as integer, no rounding, simply ignoring all decimal places
* <tt><#tag_name tc=y></tt> truncates output, display as integer, no rounding, simply ignoring all decimal places


If the tag name gives an output that is defined as text, or as an integer, then none of these can be used. It depends upon which release you are using whether a particular "real number" tag name will accept any of the above output modification parameters, gradually Cumulus has allowed more and more of its output to take an output format modifier that allows people to control number of decimal places shown.
If the tag name gives an output that is defined as text, or as an integer, then none of these can be used.
 
Internally, Cumulus stores numbers in binary. You cannot represent base 10 decimal places exactly in base 2.


''[Remove this after review?? HansR]''
Weather stations report [[Calculate_Missing_Values#Source_value|values]] as integers.  Cumulus converts these to the user's desired units, and that processing can add decimal places, as it may involve division by a factor of 10, or multiplication by a conversion factor.  Obviously, the sensor has a particular accuracy, and this conversion process can introduce additional errors, as can the storing in binary, Cumulus generally (not in every case) stores to a precision that would generally give about 24 significant figures when expressed in base 10.  
Weather stations report [[Calculate_Missing_Values#Source_value|values]] as integers.  Cumulus converts these to the user's desired units, and that processing can add decimal places, as it may involve division by a factor of 10, or multiplication by a conversion factor.  Obviously, the sensor has a particular accuracy, and this conversion process can introduce additional errors, as can the storing in binary, Cumulus generally (not in every case) stores to a precision that would generally give about 24 significant figures when expressed in base 10.  


The handling of each tag name is coded individually, so there are no simple rules for defining the default number of decimal points that will be shown by default. In general, Cumulus does consider the units chosen for outputs.  As Cumulus has been developed, people have commented that these defaults do not reflect the precision of their instrumentation (weather stations used with Cumulus tend not to have the accuracy of those used by meteorologists, or are not re-calibrated as often).  
The handling of each tag name is coded individually, so there are no simple rules for defining the default number of decimal points that will be shown by default. In general, Cumulus does consider the units chosen for outputs.  As Cumulus has been developed, people have commented that these defaults do not reflect the precision of their instrumentation (weather stations used with Cumulus tend not to have the accuracy of those used by meteorologists, or are not re-calibrated as often).  
''[END Remove this after review?? HansR]''


[[File:Badge vMx.png]]From release 3.12.0, you can set the default number of decimal places to output for all derivatives of temperature, pressure, etc. by [[Cumulus.ini#Units.2C_Derivative_Options.2C_and_Decimal_Places|advanced settings]]. Those settings can force output as integers, in which case the parameter for controlling number of decimal places have no effect.
From release 3.12.0, you can set the default number of decimal places to output for all derivatives of temperature, pressure, etc. by [[Cumulus.ini#Units.2C_Derivative_Options.2C_and_Decimal_Places|advanced settings]]. Those settings can force output as integers, in which case the parameter for controlling number of decimal places have no effect.


==== Two Output (format modifier) parameters for decimal places ====
==== Two Output (format modifier) parameters for decimal places ====