Webtags (preserving history): Difference between revisions

m
Line 125: Line 125:


=Output 'format' Parameter=
=Output 'format' Parameter=
=== Output Parameter Differences between Cumulus 1 and Cumulus MX (Cumulus 3) ===
*Cumulus MX (when running on Windows) uses the '''.NET''' (MONO is a operating system independent version of .NET) date and time format characters that are not exactly the same as the '''Delphi''' ones that Cumulus 1 uses.  For Cumulus MX see [http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx this Microsoft site] for format selectors. The differences come about because Delphi is case-insensitive, and .NET is case sensitive, so .NET can use upper and lower case for different items, where Delphi has to use different letters. If Cumulus MX is running on Linux or Mac OS X, then it uses '''Mono''' for date and time formatting, but the same case sensitive rules apply as for .NET.
*#For example,[[File:badge v1.png]] in Delphi, "nn" means "minutes" for Cumulus 1, [[File:Badge vMx.png]]but "minutes" is "mm" for .Net in Cumulus MX.
*# e.g. the hour in 24-hour format, is "HH" (although in Delphi (Cumulus 1)'hh' would be treated same) but in .NET it must be "HH" (Cumulus MX).
*[[File:Badge vMx.png]]You might be put off by references within .NET (Cumulus MX) to single/standard characters and custom modifiers, the following 3 examples may add clarity:
*#For example ''<#MonthTempHD format="d">'' is a single character format modifier, therefore the 'd' acts as a standard modifier, and causes a date of 22 July 2014 for the highest temperature in the month to be returned in the standard short date format e.g. '22/07/2014' (exact contents for any one date vary by locale).
*#Similarly ''<#MonthTempHD format="M">'' is a single character format modifier and therefore the 'M' acts as a standard modifier and causes the date for the highest temperature in the month to be returned in the standard day and month format e.g. '22 July' (exact contents for any one date vary by locale).
*#Whilst ''<#metdate format="d M">'' is not a single character format modifier and therefore both the 'd' and the 'M' are interpreted as custom modifiers and cause the current date to be returned as a digit(s) for the day and a digit(s) month (in a without leading zeroes format) e.g. '6 7' would be returned for 6 July.
*The other change with the "format" parameter is the different way that .Net escapes characters that are not being used as format specifiers. In [[File:badge v1.png]]Delphi you can put the 'verbatim' characters inside single quotes (Cumulus 1); in [[File:Badge vMx.png]].NET you can still use single quotes, but alternatively you can escape each verbatim character with a backslash as prefix (Cumulus MX).
For official full details see [https://cumulus.hosiene.co.uk/viewtopic.php?f=39&t=17888 Cumulus MX forum], the following table is revised for simplicity. (I've abridged the table here and included '%' where necessary to avoid single character versus custom complications).
==== Using HTML tags within format parameters (MX only) ====
'''Example using a class to change the look of part of the output'''
<pre><#TapptempH format="dd'&nbsp;'MMM'&nbsp;'yyyy'<span class=\'xx\'> at 'HH:mm'</span>'"></pre>
the output from this will look like ''04&nbsp;Dec&nbsp;2018<span class='xx'> at 10:12</span>''
Note where the quotes are, and where you need to use '\' escape characters.
'''Example using HTML tags'''
<pre><#RecentTS d=2 format="h:mm'&nbsp;'tt'<small>on' d/M/yyyy'</small>'"></pre>
This puts the date in a smaller font than the time


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


*<tt>dp=i</tt> is used for both Cumulus 1 and MX. The value '''i''' following the attribute '''dp''' is an integer, how many decimal places you want for the output you see. Only available for a limited range of web tags (including in MX <#MoonPercent> and <#MoonPercentAbs>).
 
*<tt>tc=y</tt> is a new parameter for MX, the attribute '''tc''' takes the value 'y' to remove decimal places by truncation instead of using <tt>dp=0</tt> which would round to nearest integer. e.g. <#MoonAge tc=y>. At present not available in any other web tags.
Cumulus 1 allows use of <tt>dp=n</tt> modifier (where n represents desired number of decimal places for latitude and longitude e.g. <#latitude dp=5> gives "59.24250". This is also available in MX.
MX makes much more usage of these '''dp''' parameters. For example in the moon tags  <#MoonAge> gives "11" but <#MoonAge dp=3> gives "11.234"
 
*<tt>dp=i</tt> is used for both Cumulus 1 and MX. The value '''i''' following the attribute '''dp''' is an integer, how many decimal places you want for the output you see. Only available for a limited range of web tags (latitude and longitude, plus in MX <#MoonPercent> and <#MoonPercentAbs>).
*<tt>tc=y</tt> is a new parameter only in MX, the attribute '''tc''' takes the value 'y' to remove decimal places by truncation instead of using <tt>dp=0</tt> which would round to nearest integer. e.g. <#MoonAge tc=y>. At present not available in any other web tags.


=== Output (format modifier) indicating remove commas ===
=== Output (format modifier) indicating remove commas ===
5,838

edits