<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.webcore.co/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ahndee</id>
		<title>webCoRE Wiki - Web-enabled Community's own Rule Engine - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.webcore.co/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ahndee"/>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/Special:Contributions/Ahndee"/>
		<updated>2026-05-15T16:55:45Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=File:Weather_Hourly.png&amp;diff=662</id>
		<title>File:Weather Hourly.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=File:Weather_Hourly.png&amp;diff=662"/>
				<updated>2017-10-26T16:27:55Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Ahndee uploaded a new version of File:Weather Hourly.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=File:Weather_Daily.png&amp;diff=661</id>
		<title>File:Weather Daily.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=File:Weather_Daily.png&amp;diff=661"/>
				<updated>2017-10-26T16:27:27Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Ahndee uploaded a new version of File:Weather Daily.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=Samples&amp;diff=660</id>
		<title>Samples</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=Samples&amp;diff=660"/>
				<updated>2017-10-26T16:26:26Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: /* Weather Tiles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an ongoing library of examples so please let me know what else you would like to see on here.  Please get a hold of [https://community.smartthings.com/users/c1arkbar/activity @c1arkbar] &amp;lt;!-- anyone else who would like to add your name please do so --&amp;gt; on the ST forums if you would like to see anything added to this page.&lt;br /&gt;
&lt;br /&gt;
= Simple Pistons =&lt;br /&gt;
These are going to be pretty basic beginner level pistons.  &lt;br /&gt;
== Motion Based ==&lt;br /&gt;
*'''Simple Motion Piston'''&lt;br /&gt;
: When the motion sensor changes to active, a light will turn on. &amp;lt;code&amp;gt;'''hsv3h'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:simplemotion.png]]&lt;br /&gt;
*'''Complex Motion Piston'''  &lt;br /&gt;
::This piston will turn on a light with motion and off after 2 minutes of no motion. &amp;lt;code&amp;gt;'''p3rz7'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:complexmotionv2.png]]&lt;br /&gt;
&lt;br /&gt;
== Motion Based EXCEPT When Manually Turned On ==&lt;br /&gt;
*'''Advanced Motion Piston'''  &lt;br /&gt;
::This piston will turn on a light with motion and off after 5 minutes of no motion. But if user switches the light on it will not be turned off by motion, instead user will need to turn if off. If motion turned on the light and you want it to stay on till you turn it off, just switch the light off and on. The isBetween check sets the light level to 100% when between 4am to 11pm otherwise to 10% only when turned on by motion. note that while i use a light in this example it could be any device controlled by motion. &amp;lt;code&amp;gt;'''edsh2'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:advancedmotionv1.png]]&lt;br /&gt;
&lt;br /&gt;
== Time Based ==&lt;br /&gt;
*'''Happens At (with offset)'''  &lt;br /&gt;
::This piston will execute at the specified time daily. Used an expression to fire this piston off 1 hour before sunset. &amp;lt;code&amp;gt;1citwt&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:happensat.png]]&lt;br /&gt;
*'''Time Between'''&lt;br /&gt;
::This piston will execute between the specified times. &amp;lt;code&amp;gt;x3pcd&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:timebetween.png]]&lt;br /&gt;
&lt;br /&gt;
== Presence Tiles ==&lt;br /&gt;
*'''Presence Tiles'''  &lt;br /&gt;
::Presence tiles piston, what i use myself. More on the piston in the piston comments.&amp;lt;code&amp;gt;v78tz&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:People_Presence_Tiles_Example_Piston.png]]&lt;br /&gt;
&lt;br /&gt;
== Weather Tiles ==&lt;br /&gt;
*'''Weather Tiles''' &lt;br /&gt;
::The following two pistons show the weather forecast for the next few days &amp;amp; nights as well as the hourly forecast for the next 16 hours (conditions, chance of rain, temperature, and humidity). The background of the tiles changes based on average temperature (the colors and values for the coldest and warmest temperatures can be adjusted in the pistons - values between those two will be interpolated). The pistons can be easily changed to use °C instead of °F and use AM/PM rather the 24h time display by changing the respective boolean variables at the top of the piston.&lt;br /&gt;
::Here is what the tiles for those two pistons look like (during a somewhat boring forecast with not a lot of temperature variation):&lt;br /&gt;
::[[File:Weather_Tiles.png|800px|Sample display for weather tiles on webCORE dashboard]]&lt;br /&gt;
::Piston for the daily forecast tiles &amp;lt;code&amp;gt;gkws&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:Weather_Daily.png|800px|Daily forecast piston]]&lt;br /&gt;
::Piston for the hourly forecast tiles &amp;lt;code&amp;gt;s66j&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:Weather_Hourly.png|800px|Hourly forecast piston]]&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
*'''Mirrored Switch'''  &lt;br /&gt;
::This piston will mirror one switch to another. &amp;lt;code&amp;gt;1ai665&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:mirrorswitch.png]]&lt;br /&gt;
*'''Weather'''  &lt;br /&gt;
::This piston will change the color of a bulb to blue if weather is below freezing. &amp;lt;code&amp;gt;hmfm5&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:weather.png]]&lt;br /&gt;
&lt;br /&gt;
=Advanced Pistons = &amp;lt;!-- If you would like to share some of your personal pistons then add them with the same format as mine below --&amp;gt;&lt;br /&gt;
== [https://community.smartthings.com/users/c1arkbar/activity @c1arkbar] ==&lt;br /&gt;
*'''House Scheduler'''  &lt;br /&gt;
:This is one of two pistons that controls my home's mode and SHM. This is time based with presence as additional conditions.  I currently have 7 modes for my house.  Away - (Dawn/Day/Night), Home - (Dawn/Day/Night) and Sleep.  As the day progresses the mode will change based on the time and presence of myself and/or girlfriend.&amp;lt;code&amp;gt;1hj33x&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:myschedule.png]]&lt;br /&gt;
*'''Magic Home'''  &lt;br /&gt;
:This is one of two pistons that controls my home's mode and SHM. This piston works the opposite of the above in that the main driver of this piston is presence with time as additional conditions. When myself or my girlfriend get home, it checks to see who is arriving and which vehicle is missing for that person to determine which garage to open. After that it will assign the correct mode to the house and then send a push notification welcoming you home and letting you know that the garage is opening for you unless it is already open.  Similarly when one of us leaves the house will give a goodbye message but if both of us are gone then it will alert the last person that all the lights have been turned off.  &amp;lt;code&amp;gt;dyf6&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:Magichomev2.png]]&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=Samples&amp;diff=659</id>
		<title>Samples</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=Samples&amp;diff=659"/>
				<updated>2017-10-26T16:24:09Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: /* Weather Tiles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an ongoing library of examples so please let me know what else you would like to see on here.  Please get a hold of [https://community.smartthings.com/users/c1arkbar/activity @c1arkbar] &amp;lt;!-- anyone else who would like to add your name please do so --&amp;gt; on the ST forums if you would like to see anything added to this page.&lt;br /&gt;
&lt;br /&gt;
= Simple Pistons =&lt;br /&gt;
These are going to be pretty basic beginner level pistons.  &lt;br /&gt;
== Motion Based ==&lt;br /&gt;
*'''Simple Motion Piston'''&lt;br /&gt;
: When the motion sensor changes to active, a light will turn on. &amp;lt;code&amp;gt;'''hsv3h'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:simplemotion.png]]&lt;br /&gt;
*'''Complex Motion Piston'''  &lt;br /&gt;
::This piston will turn on a light with motion and off after 2 minutes of no motion. &amp;lt;code&amp;gt;'''p3rz7'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:complexmotionv2.png]]&lt;br /&gt;
&lt;br /&gt;
== Motion Based EXCEPT When Manually Turned On ==&lt;br /&gt;
*'''Advanced Motion Piston'''  &lt;br /&gt;
::This piston will turn on a light with motion and off after 5 minutes of no motion. But if user switches the light on it will not be turned off by motion, instead user will need to turn if off. If motion turned on the light and you want it to stay on till you turn it off, just switch the light off and on. The isBetween check sets the light level to 100% when between 4am to 11pm otherwise to 10% only when turned on by motion. note that while i use a light in this example it could be any device controlled by motion. &amp;lt;code&amp;gt;'''edsh2'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:advancedmotionv1.png]]&lt;br /&gt;
&lt;br /&gt;
== Time Based ==&lt;br /&gt;
*'''Happens At (with offset)'''  &lt;br /&gt;
::This piston will execute at the specified time daily. Used an expression to fire this piston off 1 hour before sunset. &amp;lt;code&amp;gt;1citwt&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:happensat.png]]&lt;br /&gt;
*'''Time Between'''&lt;br /&gt;
::This piston will execute between the specified times. &amp;lt;code&amp;gt;x3pcd&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:timebetween.png]]&lt;br /&gt;
&lt;br /&gt;
== Presence Tiles ==&lt;br /&gt;
*'''Presence Tiles'''  &lt;br /&gt;
::Presence tiles piston, what i use myself. More on the piston in the piston comments.&amp;lt;code&amp;gt;v78tz&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:People_Presence_Tiles_Example_Piston.png]]&lt;br /&gt;
&lt;br /&gt;
== Weather Tiles ==&lt;br /&gt;
*'''Weather Tiles''' &lt;br /&gt;
::The following two pistons show the weather forecast for the next few days &amp;amp; nights as well as the hourly forecast for the next 16 hours (conditions, chance of rain, temperature, and humidity). The background of the tiles changes based on average temperature (the colors and values for the coldest and warmest temperatures can be adjusted in the pistons - values between those two will be interpolated). The pistons can be easily changed to use °C instead of °F and use AM/PM rather the 24h time display by changing the respective boolean variables at the top of the piston.&lt;br /&gt;
::Here is what the tiles for those two pistons look like (during a somewhat boring forecast with not a lot of temperature variation):&lt;br /&gt;
::[[File:Weather_Tiles.png|800px|Sample display for weather tiles on webCORE dashboard]]&lt;br /&gt;
::Piston for the daily forecast tiles &amp;lt;code&amp;gt;8zf6&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:Weather_Daily.png|800px|Daily forecast piston]]&lt;br /&gt;
::Piston for the hourly forecast tiles &amp;lt;code&amp;gt;nwbt&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:Weather_Hourly.png|800px|Hourly forecast piston]]&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
*'''Mirrored Switch'''  &lt;br /&gt;
::This piston will mirror one switch to another. &amp;lt;code&amp;gt;1ai665&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:mirrorswitch.png]]&lt;br /&gt;
*'''Weather'''  &lt;br /&gt;
::This piston will change the color of a bulb to blue if weather is below freezing. &amp;lt;code&amp;gt;hmfm5&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:weather.png]]&lt;br /&gt;
&lt;br /&gt;
=Advanced Pistons = &amp;lt;!-- If you would like to share some of your personal pistons then add them with the same format as mine below --&amp;gt;&lt;br /&gt;
== [https://community.smartthings.com/users/c1arkbar/activity @c1arkbar] ==&lt;br /&gt;
*'''House Scheduler'''  &lt;br /&gt;
:This is one of two pistons that controls my home's mode and SHM. This is time based with presence as additional conditions.  I currently have 7 modes for my house.  Away - (Dawn/Day/Night), Home - (Dawn/Day/Night) and Sleep.  As the day progresses the mode will change based on the time and presence of myself and/or girlfriend.&amp;lt;code&amp;gt;1hj33x&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:myschedule.png]]&lt;br /&gt;
*'''Magic Home'''  &lt;br /&gt;
:This is one of two pistons that controls my home's mode and SHM. This piston works the opposite of the above in that the main driver of this piston is presence with time as additional conditions. When myself or my girlfriend get home, it checks to see who is arriving and which vehicle is missing for that person to determine which garage to open. After that it will assign the correct mode to the house and then send a push notification welcoming you home and letting you know that the garage is opening for you unless it is already open.  Similarly when one of us leaves the house will give a goodbye message but if both of us are gone then it will alert the last person that all the lights have been turned off.  &amp;lt;code&amp;gt;dyf6&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:Magichomev2.png]]&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=658</id>
		<title>File:Weather Tiles.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=658"/>
				<updated>2017-10-26T16:21:18Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Ahndee uploaded a new version of File:Weather Tiles.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=657</id>
		<title>File:Weather Tiles.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=657"/>
				<updated>2017-10-24T15:49:20Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Ahndee uploaded a new version of File:Weather Tiles.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=656</id>
		<title>File:Weather Tiles.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=656"/>
				<updated>2017-10-24T15:48:20Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Ahndee uploaded a new version of File:Weather Tiles.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=655</id>
		<title>File:Weather Tiles.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=655"/>
				<updated>2017-10-24T15:47:17Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Ahndee uploaded a new version of File:Weather Tiles.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=635</id>
		<title>File:Weather Tiles.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=635"/>
				<updated>2017-08-03T15:32:34Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Ahndee uploaded a new version of File:Weather Tiles.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=Samples&amp;diff=634</id>
		<title>Samples</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=Samples&amp;diff=634"/>
				<updated>2017-08-02T21:01:19Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an ongoing library of examples so please let me know what else you would like to see on here.  Please get a hold of [https://community.smartthings.com/users/c1arkbar/activity @c1arkbar] &amp;lt;!-- anyone else who would like to add your name please do so --&amp;gt; on the ST forums if you would like to see anything added to this page.&lt;br /&gt;
&lt;br /&gt;
= Simple Pistons =&lt;br /&gt;
These are going to be pretty basic beginner level pistons.  &lt;br /&gt;
== Motion Based ==&lt;br /&gt;
*'''Simple Motion Piston'''&lt;br /&gt;
: When the motion sensor changes to active, a light will turn on. &amp;lt;code&amp;gt;'''hsv3h'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:simplemotion.png]]&lt;br /&gt;
*'''Complex Motion Piston'''  &lt;br /&gt;
::This piston will turn on a light with motion and off after 2 minutes of no motion. &amp;lt;code&amp;gt;'''p3rz7'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:complexmotionv2.png]]&lt;br /&gt;
&lt;br /&gt;
== Motion Based EXCEPT When Manually Turned On ==&lt;br /&gt;
*'''Advanced Motion Piston'''  &lt;br /&gt;
::This piston will turn on a light with motion and off after 5 minutes of no motion. But if user switches the light on it will not be turned off by motion, instead user will need to turn if off. If motion turned on the light and you want it to stay on till you turn it off, just switch the light off and on. The isBetween check sets the light level to 100% when between 4am to 11pm otherwise to 10% only when turned on by motion. note that while i use a light in this example it could be any device controlled by motion. &amp;lt;code&amp;gt;'''edsh2'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:advancedmotionv1.png]]&lt;br /&gt;
&lt;br /&gt;
== Time Based ==&lt;br /&gt;
*'''Happens At (with offset)'''  &lt;br /&gt;
::This piston will execute at the specified time daily. Used an expression to fire this piston off 1 hour before sunset. &amp;lt;code&amp;gt;1citwt&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:happensat.png]]&lt;br /&gt;
*'''Time Between'''&lt;br /&gt;
::This piston will execute between the specified times. &amp;lt;code&amp;gt;x3pcd&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:timebetween.png]]&lt;br /&gt;
&lt;br /&gt;
== Presence Tiles ==&lt;br /&gt;
*'''Presence Tiles'''  &lt;br /&gt;
::Presence tiles piston, what i use myself. More on the piston in the piston comments.&amp;lt;code&amp;gt;v78tz&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:People_Presence_Tiles_Example_Piston.png]]&lt;br /&gt;
&lt;br /&gt;
== Weather Tiles ==&lt;br /&gt;
*'''Weather Tiles''' &lt;br /&gt;
::The following two pistons show the weather forecast for the next few days &amp;amp; nights as well as the hourly forecast for the next 16 hours (conditions, temperature, and humidity). The background of the tiles changes based on average temperature (the colors and values for the coldest and warmest temperatures can be adjusted in the pistons - values between those two will be interpolated). The pistons can be easily changed to use °C instead of °F and use AM/PM rather the 24h time display by changing the respective boolean variables at the top of the piston.&lt;br /&gt;
::Here is what the tiles for those two pistons look like (during a somewhat boring forecast with not a lot of temperature variation):&lt;br /&gt;
::[[File:Weather_Tiles.png|800px|Sample display for weather tiles on webCORE dashboard]]&lt;br /&gt;
::Piston for the daily forecast tiles &amp;lt;code&amp;gt;8zf6&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:Weather_Daily.png|800px|Daily forecast piston]]&lt;br /&gt;
::Piston for the hourly forecast tiles &amp;lt;code&amp;gt;nwbt&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:Weather_Hourly.png|800px|Hourly forecast piston]]&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
*'''Mirrored Switch'''  &lt;br /&gt;
::This piston will mirror one switch to another. &amp;lt;code&amp;gt;1ai665&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:mirrorswitch.png]]&lt;br /&gt;
*'''Weather'''  &lt;br /&gt;
::This piston will change the color of a bulb to blue if weather is below freezing. &amp;lt;code&amp;gt;hmfm5&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:weather.png]]&lt;br /&gt;
&lt;br /&gt;
=Advanced Pistons = &amp;lt;!-- If you would like to share some of your personal pistons then add them with the same format as mine below --&amp;gt;&lt;br /&gt;
== [https://community.smartthings.com/users/c1arkbar/activity @c1arkbar] ==&lt;br /&gt;
*'''House Scheduler'''  &lt;br /&gt;
:This is one of two pistons that controls my home's mode and SHM. This is time based with presence as additional conditions.  I currently have 7 modes for my house.  Away - (Dawn/Day/Night), Home - (Dawn/Day/Night) and Sleep.  As the day progresses the mode will change based on the time and presence of myself and/or girlfriend.&amp;lt;code&amp;gt;1hj33x&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:myschedule.png]]&lt;br /&gt;
*'''Magic Home'''  &lt;br /&gt;
:This is one of two pistons that controls my home's mode and SHM. This piston works the opposite of the above in that the main driver of this piston is presence with time as additional conditions. When myself or my girlfriend get home, it checks to see who is arriving and which vehicle is missing for that person to determine which garage to open. After that it will assign the correct mode to the house and then send a push notification welcoming you home and letting you know that the garage is opening for you unless it is already open.  Similarly when one of us leaves the house will give a goodbye message but if both of us are gone then it will alert the last person that all the lights have been turned off.  &amp;lt;code&amp;gt;9ev6l&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:magichome.png]]&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=633</id>
		<title>File:Weather Tiles.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=633"/>
				<updated>2017-08-02T15:51:17Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Ahndee uploaded a new version of File:Weather Tiles.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=632</id>
		<title>File:Weather Tiles.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=632"/>
				<updated>2017-08-02T15:44:15Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Ahndee uploaded a new version of File:Weather Tiles.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=631</id>
		<title>File:Weather Tiles.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=631"/>
				<updated>2017-08-02T15:43:22Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Ahndee uploaded a new version of File:Weather Tiles.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=Samples&amp;diff=623</id>
		<title>Samples</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=Samples&amp;diff=623"/>
				<updated>2017-07-29T05:19:32Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: /* Weather Tiles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an ongoing library of examples so please let me know what else you would like to see on here.  Please get a hold of [https://community.smartthings.com/users/c1arkbar/activity @c1arkbar] &amp;lt;!-- anyone else who would like to add your name please do so --&amp;gt; on the ST forums if you would like to see anything added to this page.&lt;br /&gt;
&lt;br /&gt;
= Simple Pistons =&lt;br /&gt;
These are going to be pretty basic beginner level pistons.  &lt;br /&gt;
== Motion Based ==&lt;br /&gt;
*'''Simple Motion Piston'''&lt;br /&gt;
: When the motion sensor changes to active, a light will turn on. &amp;lt;code&amp;gt;'''hsv3h'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:simplemotion.png]]&lt;br /&gt;
*'''Complex Motion Piston'''  &lt;br /&gt;
::This piston will turn on a light with motion and off after 2 minutes of no motion. &amp;lt;code&amp;gt;'''p3rz7'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:complexmotionv2.png]]&lt;br /&gt;
*'''Advanced Motion Piston'''  &lt;br /&gt;
::This piston will turn on a light with motion and off after 5 minutes of no motion. But if user switches the light on it will not be turned off by motion, instead user will need to turn if off. If motion turned on the light and you want it to stay on till you turn it off, just switch the light off and on. The isBetween check sets the light level to 100% when between 4am to 11pm otherwise to 10% only when turned on by motion. note that while i use a light in this example it could be any device controlled by motion. &amp;lt;code&amp;gt;'''edsh2'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:advancedmotionv1.png]]&lt;br /&gt;
&lt;br /&gt;
== Time Based ==&lt;br /&gt;
*'''Happens At (with offset)'''  &lt;br /&gt;
::This piston will execute at the specified time daily. Used an expression to fire this piston off 1 hour before sunset. &amp;lt;code&amp;gt;1citwt&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:happensat.png]]&lt;br /&gt;
*'''Time Between'''&lt;br /&gt;
::This piston will execute between the specified times. &amp;lt;code&amp;gt;x3pcd&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:timebetween.png]]&lt;br /&gt;
&lt;br /&gt;
== Presence Tiles ==&lt;br /&gt;
*'''Presence Tiles'''  &lt;br /&gt;
::Presence tiles piston, what i use myself. More on the piston in the piston comments.&amp;lt;code&amp;gt;v78tz&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:People_Presence_Tiles_Example_Piston.png]]&lt;br /&gt;
&lt;br /&gt;
== Weather Tiles ==&lt;br /&gt;
*'''Weather Tiles''' &lt;br /&gt;
::The following two pistons show the weather forecast for the next few days &amp;amp; nights as well as the hourly forecast for the next 16 hours (conditions, temperature, and humidity). The background of the tiles changes based on average temperature (the colors and values for the coldest and warmest temperatures can be adjusted in the pistons - values between those two will be interpolated). The pistons can be easily changed to use °C instead of °F and use AM/PM rather the 24h time display by changing the respective boolean variables at the top of the piston.&lt;br /&gt;
::Here is what the tiles for those two pistons look like (during a somewhat boring forecast with not a lot of temperature variation):&lt;br /&gt;
::[[File:Weather_Tiles.png|800px]]&lt;br /&gt;
::Piston for the daily forecast tiles &amp;lt;code&amp;gt;8zf6&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:Weather_Daily.png|800px]]&lt;br /&gt;
::Piston for the hourly forecast tiles &amp;lt;code&amp;gt;nwbt&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:Weather_Hourly.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
*'''Mirrored Switch'''  &lt;br /&gt;
::This piston will mirror one switch to another. &amp;lt;code&amp;gt;1ai665&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:mirrorswitch.png]]&lt;br /&gt;
*'''Weather'''  &lt;br /&gt;
::This piston will change the color of a bulb to blue if weather is below freezing. &amp;lt;code&amp;gt;hmfm5&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:weather.png]]&lt;br /&gt;
&lt;br /&gt;
=Advanced Pistons = &amp;lt;!-- If you would like to share some of your personal pistons then add them with the same format as mine below --&amp;gt;&lt;br /&gt;
== [https://community.smartthings.com/users/c1arkbar/activity @c1arkbar] ==&lt;br /&gt;
*'''House Scheduler'''  &lt;br /&gt;
:This is one of two pistons that controls my home's mode and SHM. This is time based with presence as additional conditions.  I currently have 7 modes for my house.  Away - (Dawn/Day/Night), Home - (Dawn/Day/Night) and Sleep.  As the day progresses the mode will change based on the time and presence of myself and/or girlfriend.&amp;lt;code&amp;gt;1hj33x&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:myschedule.png]]&lt;br /&gt;
*'''Magic Home'''  &lt;br /&gt;
:This is one of two pistons that controls my home's mode and SHM. This piston works the opposite of the above in that the main driver of this piston is presence with time as additional conditions. When myself or my girlfriend get home, it checks to see who is arriving and which vehicle is missing for that person to determine which garage to open. After that it will assign the correct mode to the house and then send a push notification welcoming you home and letting you know that the garage is opening for you unless it is already open.  Similarly when one of us leaves the house will give a goodbye message but if both of us are gone then it will alert the last person that all the lights have been turned off.  &amp;lt;code&amp;gt;9ev6l&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:magichome.png]]&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=File:Weather_Hourly.png&amp;diff=622</id>
		<title>File:Weather Hourly.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=File:Weather_Hourly.png&amp;diff=622"/>
				<updated>2017-07-29T05:10:10Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=File:Weather_Daily.png&amp;diff=621</id>
		<title>File:Weather Daily.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=File:Weather_Daily.png&amp;diff=621"/>
				<updated>2017-07-29T05:09:54Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=620</id>
		<title>File:Weather Tiles.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=File:Weather_Tiles.png&amp;diff=620"/>
				<updated>2017-07-29T05:09:36Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=Samples&amp;diff=619</id>
		<title>Samples</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=Samples&amp;diff=619"/>
				<updated>2017-07-29T05:08:59Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: /* Simple Pistons */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is an ongoing library of examples so please let me know what else you would like to see on here.  Please get a hold of [https://community.smartthings.com/users/c1arkbar/activity @c1arkbar] &amp;lt;!-- anyone else who would like to add your name please do so --&amp;gt; on the ST forums if you would like to see anything added to this page.&lt;br /&gt;
&lt;br /&gt;
= Simple Pistons =&lt;br /&gt;
These are going to be pretty basic beginner level pistons.  &lt;br /&gt;
== Motion Based ==&lt;br /&gt;
*'''Simple Motion Piston'''&lt;br /&gt;
: When the motion sensor changes to active, a light will turn on. &amp;lt;code&amp;gt;'''hsv3h'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:simplemotion.png]]&lt;br /&gt;
*'''Complex Motion Piston'''  &lt;br /&gt;
::This piston will turn on a light with motion and off after 2 minutes of no motion. &amp;lt;code&amp;gt;'''p3rz7'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:complexmotionv2.png]]&lt;br /&gt;
*'''Advanced Motion Piston'''  &lt;br /&gt;
::This piston will turn on a light with motion and off after 5 minutes of no motion. But if user switches the light on it will not be turned off by motion, instead user will need to turn if off. If motion turned on the light and you want it to stay on till you turn it off, just switch the light off and on. The isBetween check sets the light level to 100% when between 4am to 11pm otherwise to 10% only when turned on by motion. note that while i use a light in this example it could be any device controlled by motion. &amp;lt;code&amp;gt;'''edsh2'''&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:advancedmotionv1.png]]&lt;br /&gt;
&lt;br /&gt;
== Time Based ==&lt;br /&gt;
*'''Happens At (with offset)'''  &lt;br /&gt;
::This piston will execute at the specified time daily. Used an expression to fire this piston off 1 hour before sunset. &amp;lt;code&amp;gt;1citwt&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:happensat.png]]&lt;br /&gt;
*'''Time Between'''&lt;br /&gt;
::This piston will execute between the specified times. &amp;lt;code&amp;gt;x3pcd&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:timebetween.png]]&lt;br /&gt;
&lt;br /&gt;
== Presence Tiles ==&lt;br /&gt;
*'''Presence Tiles'''  &lt;br /&gt;
::Presence tiles piston, what i use myself. More on the piston in the piston comments.&amp;lt;code&amp;gt;v78tz&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:People_Presence_Tiles_Example_Piston.png]]&lt;br /&gt;
&lt;br /&gt;
== Weather Tiles ==&lt;br /&gt;
*'''Weather Tiles''' &lt;br /&gt;
::The following two pistons show the weather forecast for the next few days &amp;amp; nights as well as the hourly forecast for the next 16 hours. The background of the tiles changes based on average temperature (the colors and values for the coldest and warmest temperatures can be adjusted in the pistons - values between those two will be interpolated)&lt;br /&gt;
::Here is what the tiles for those two pistons look like (during a somewhat boring forecast with not a lot of temperature variation):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
*'''Mirrored Switch'''  &lt;br /&gt;
::This piston will mirror one switch to another. &amp;lt;code&amp;gt;1ai665&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:mirrorswitch.png]]&lt;br /&gt;
*'''Weather'''  &lt;br /&gt;
::This piston will change the color of a bulb to blue if weather is below freezing. &amp;lt;code&amp;gt;hmfm5&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:weather.png]]&lt;br /&gt;
&lt;br /&gt;
=Advanced Pistons = &amp;lt;!-- If you would like to share some of your personal pistons then add them with the same format as mine below --&amp;gt;&lt;br /&gt;
== [https://community.smartthings.com/users/c1arkbar/activity @c1arkbar] ==&lt;br /&gt;
*'''House Scheduler'''  &lt;br /&gt;
:This is one of two pistons that controls my home's mode and SHM. This is time based with presence as additional conditions.  I currently have 7 modes for my house.  Away - (Dawn/Day/Night), Home - (Dawn/Day/Night) and Sleep.  As the day progresses the mode will change based on the time and presence of myself and/or girlfriend.&amp;lt;code&amp;gt;1hj33x&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:myschedule.png]]&lt;br /&gt;
*'''Magic Home'''  &lt;br /&gt;
:This is one of two pistons that controls my home's mode and SHM. This piston works the opposite of the above in that the main driver of this piston is presence with time as additional conditions. When myself or my girlfriend get home, it checks to see who is arriving and which vehicle is missing for that person to determine which garage to open. After that it will assign the correct mode to the house and then send a push notification welcoming you home and letting you know that the garage is opening for you unless it is already open.  Similarly when one of us leaves the house will give a goodbye message but if both of us are gone then it will alert the last person that all the lights have been turned off.  &amp;lt;code&amp;gt;9ev6l&amp;lt;/code&amp;gt;&lt;br /&gt;
::[[File:magichome.png]]&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=Functions&amp;diff=515</id>
		<title>Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=Functions&amp;diff=515"/>
				<updated>2017-07-17T20:23:22Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: /* abs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: left; clear: both; margin-right: 1em; margin-bottom: 1em;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
Functions are extensions to expressions that allow data processing and conversion. Here is a list of all defined functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#String|String]] functions=&lt;br /&gt;
&lt;br /&gt;
==concat==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' concat(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that is the concatenation of all the supplied values. This function accepts two or more input values.&lt;br /&gt;
&lt;br /&gt;
==contains==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' contains(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; is found anywhere in the &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==endsWith==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' endsWith(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; ends with the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==format==&lt;br /&gt;
[[File:Format.pdf|page=1|thumb|256px|A very nice article written by Professor Don Colton, at the Brigham Young University of Hawaii]]&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' format(''string'' formatString[, ''dynamic'' value1[, .., ''dynamic'' valueN]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that is built based on the &amp;lt;code&amp;gt;formatString&amp;lt;/code&amp;gt; with arguments replaced by their corresponding values. Follows the java syntax for &amp;lt;code&amp;gt;printf()&amp;lt;/code&amp;gt;. See a quick reference [https://www.cs.colostate.edu/~cs160/.Summer16/resources/Java_printf_method_quick_reference.pdf here], or a more detailed reference [https://sharkysoft.com/archive/printf/docs/javadocs/lava/clib/stdio/doc-files/specification.htm Reference here].&lt;br /&gt;
::Each % in the format string represents an argument and corresponds to a value (in order of appearance) in the value list. Each argument can have formatting settings, according to the reference provided. &lt;br /&gt;
:Example&lt;br /&gt;
::&amp;lt;code&amp;gt;format('The temperature outside is %.2f degrees Fahrenheit', [Temp sensor:temperature])&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;The temperature outside is 71.26 degrees Fahrenheit&amp;lt;/code&amp;gt;&lt;br /&gt;
::The &amp;lt;code&amp;gt;%.2f&amp;lt;/code&amp;gt; translates to &amp;quot;format as &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;loat and use &amp;lt;code&amp;gt;.2&amp;lt;/code&amp;gt; decimal places.&lt;br /&gt;
&lt;br /&gt;
==indexOf==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' indexOf(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the character index of the first occurrence of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;indexOf(&amp;quot;hello world&amp;quot;, 'l')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lastIndexOf==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' lastIndexOf(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the character index of the last occurrence of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lastIndexOf(&amp;quot;hello world&amp;quot;, 'l')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;9&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==left==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' left(''string'' value, ''integer'' length)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the first &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; characters in &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;left(&amp;quot;hello world&amp;quot;, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;he&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lower==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' lower(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but with all lower case letters.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello World&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hello world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==mid==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' mid(''string'' value, ''integer'' start[, ''integer'' count = remaining])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; - provides the 0-based index of the first character to copy. If &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; is negative, the counting starts from the end of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
::&amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; - provides the number of characters to copy from &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. If not provided, all of the remaining characters from &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; are returned, starting with character number &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is negative, prior characters are returned.&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a substring of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; characters long, starting at character number &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;. Note that the first character in any string has index 0.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, 2, 3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;llo&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;llo World&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, -5, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Wo&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, -1, -3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;orl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==random==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' random([''integer'' range | ''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; - an integer number representing a range&lt;br /&gt;
::&amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt;..&amp;lt;code&amp;gt;valueN&amp;lt;/code&amp;gt; - any kind of arguments, one will be randomly returned&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a random decimal number between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; if no arguments are provided, or a number between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; (inclusive) if a single argument is provided, or a randomly selected argument if two or more arguments are provided.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;random()&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;0.483&amp;lt;/code&amp;gt; (random decimal)&lt;br /&gt;
::&amp;lt;code&amp;gt;random(20)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; (random integer)&lt;br /&gt;
::&amp;lt;code&amp;gt;random(&amp;quot;Hello World&amp;quot;, &amp;quot;Good morning&amp;quot;, &amp;quot;Hello&amp;quot;, &amp;quot;Hi&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello&amp;lt;/code&amp;gt; (randomly selected value)&lt;br /&gt;
:Tips&lt;br /&gt;
::To output a random integer between 5 and 20 use &amp;lt;code&amp;gt;(5 + random(15))&amp;lt;/code&amp;gt;&lt;br /&gt;
::To output a random integer between -5 and 20 use &amp;lt;code&amp;gt;(-5 + random(25))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==replace==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' replace(''string'' haystack, ''string'' needle1, ''string'' replacement1[, .., ''string'' needleN, ''string'' replacementN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Replaces all the occurrences of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; with its respective &amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt;. Multiple pairs of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt; can be provided in one function call.&lt;br /&gt;
:Regular expressions&lt;br /&gt;
::Needles support regular expressions when their value starts and ends with a &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;. For example, &amp;lt;code&amp;gt;'/(\s)/'&amp;lt;/code&amp;gt; will match all spaces.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello Earth&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth', 'Hello', 'Hi')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hi Earth&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth', 'Earth', 'Planet')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello Planet&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==right==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' right(''string'' value, ''integer'' length)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the last &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; characters in &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;right(&amp;quot;hello world&amp;quot;, 4)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;orld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==startsWith==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' startsWith(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; starts with the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==string==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' string(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; as a string.&lt;br /&gt;
&lt;br /&gt;
==substr==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;mid()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==substring==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;mid()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==title==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' title(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but in its title case format (each word starts with a capitalized letter).&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello there world&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello There World&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==upper==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' upper(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but with all upper case letters.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;upper(&amp;quot;Hello World&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;HELLO WORLD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==text==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;string()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==trim==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;quot;string&amp;quot; trim(&amp;quot;string&amp;quot; value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with leading and trailing spaces removed&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;trim(&amp;quot; Hello World &amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello World&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==trimLeft==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;quot;string&amp;quot; trimLeft(&amp;quot;string&amp;quot; value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with leading spaces removed&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;trimLeft(&amp;quot; Hello World &amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;&amp;quot;Hello World &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ltrim==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;trimLeft()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==trimRight==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;quot;string&amp;quot; trimRight(&amp;quot;string&amp;quot; value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with trailing spaces removed&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;trimRight(&amp;quot; Hello World &amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;&amp;quot; Hello World&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==rtrim==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;trimRight()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Numeric functions=&lt;br /&gt;
&lt;br /&gt;
==avg==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' avg(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the mean average of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==abs==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' abs(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the absolute value of the argument (e.g., remove negative sign for negative values).&lt;br /&gt;
&lt;br /&gt;
==ceil==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' ceil(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the immediately higher integer, equivalent to rounding the decimal away from zero.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;ceil(5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;ceil(-5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;-6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ceiling==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;ceil&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==decimal==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' decimal(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; into a decimal. Returns &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is not numeric.&lt;br /&gt;
&lt;br /&gt;
==float==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;decimal&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==floor==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' ceil(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the integer part of a decimal, equivalent to rounding the decimal towards zero.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;floor(5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;floor(-5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;-5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==max==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' max(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the maximum of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==median==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' median(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the median average of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==min==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' min(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the minimum of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==number==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;decimal&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==power==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' power(''decimal'' value, ''decimal'' exponent)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; at the power of &amp;lt;code&amp;gt;exponent&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==round==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' round(''decimal'' value[, ''integer'' precision = 0])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;precision&amp;lt;/code&amp;gt; - the number of decimal places to be retained. If not provided, defaults to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the rounded &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;precision&amp;lt;/code&amp;gt; decimal places.&lt;br /&gt;
&lt;br /&gt;
==sqr==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sqr(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the squared &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, equivalent to &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; multiplied by itself.&lt;br /&gt;
&lt;br /&gt;
==sqrt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sqrt(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the square root of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==stdev==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' stdev(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the standard deviation of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==sum==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sum(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the sum of sum of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==variance==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' variance(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the variance of all the values provided.&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#Boolean|Boolean]] functions=&lt;br /&gt;
&lt;br /&gt;
==bool==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;bool(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the truth value of the input. Accepts anything as input and will return true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is either a non-zero number, a non-empty string (with some exceptions, see below), a non-empty device list, a non-empty date/time/datetime&lt;br /&gt;
&lt;br /&gt;
==boolean==&lt;br /&gt;
:This is an alias of [[Functions#bool|bool]]&lt;br /&gt;
&lt;br /&gt;
==eq==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;eq(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ge==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;ge(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is greater than or equal to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==gt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;gt(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is greater than &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==isBetween==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;isBetween(''dynamic'' value, ''dynamic'' startValue, ''dynamic'' endValue)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is greater then or equal to &amp;lt;code&amp;gt;startValue&amp;lt;/code&amp;gt; and less than or equal to &amp;lt;code&amp;gt;endValue&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==isEmpty==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;isEmpty(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is not set, an empty string, or zero&lt;br /&gt;
&lt;br /&gt;
==le==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;le(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is less than or equal to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;lt(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is less than &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==not==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;not(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the negated truth state of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. This is the logical negation of &amp;lt;code&amp;gt;[[Functions#bool|bool]](''dynamic'' value)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#Date_and_Time|Date and time]] functions=&lt;br /&gt;
&lt;br /&gt;
==addDays==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addDays(''datetime'' value, ''integer'' days)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; days after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; days before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addHours==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addHours(''datetime'' value, ''integer'' hours)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt; hours after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt; hours before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addMinutes==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addMinutes(''datetime'' value, ''integer'' minutes)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; minutes after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; minutes before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addSeconds==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addSeconds(''datetime'' value, ''integer'' seconds)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; seconds after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; seconds before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addWeeks==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addWeeks(''datetime'' value, ''integer'' weeks)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt; weeks after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt; weeks before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==date==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;date(''datetime'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the date portion of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; by stripping off time information.&lt;br /&gt;
&lt;br /&gt;
==datetime==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''datetime'' datetime(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Tries to convert any value into a datetime. Accepts strings in common date/time formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==formatDuration==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' formatDuration(''datetime'' value[, ''boolean'' friendly = false[, ''string'' granularity = 's'[, ''boolean'' showAdverbs = false]]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;friendly&amp;lt;/code&amp;gt; - &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; makes the output compact, in the form of &amp;lt;code&amp;gt;0d 00:00:00.000&amp;lt;/code&amp;gt;, while &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; makes the output more human friendly, in the form of &amp;lt;code&amp;gt; 0 days, 0 hours, 0 minutes, and 0 seconds&amp;lt;/code&amp;gt;. Defaults to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
::&amp;lt;code&amp;gt;granularity&amp;lt;/code&amp;gt; - represents the smallest time unit to be output. One of &amp;lt;code&amp;gt;d&amp;lt;/code&amp;gt; for days, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; for hours, &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; for minutes, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; for seconds, or &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; for milliseconds. Any time unit below the selected granularity will not be output. Defaults to &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;showAdverbs&amp;lt;/code&amp;gt; - only affects the friendly output, when &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; the words &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; (for future durations - positive input) or &amp;lt;code&amp;gt;ago&amp;lt;/code&amp;gt; (for past durations - negative input) are prepended or appended respectively to the output&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that represents the duration in a human readable format&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(12029)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;00:00:12&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, true)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;1 minute and 8 seconds&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, false, 'ms')&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;00:01:08&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, true, 'm', true)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;in 1 minute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==time==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''time'' time(''datetime'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the time portion of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; by stripping off date information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Weather related functions=&lt;br /&gt;
&lt;br /&gt;
==celsius==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' celsius(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts a temperature value from Fahrenheit to Celsius.&lt;br /&gt;
&lt;br /&gt;
==dewPoint==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' dewPoint(''decimal'' temperature, ''decimal'' relativeHumidity[, ''string'' scale = 'F'])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Parameters&lt;br /&gt;
::&amp;lt;code&amp;gt;scale&amp;lt;/code&amp;gt; - optional, one of &amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt;, corresponding to the temperature range used for &amp;lt;code&amp;gt;temperature&amp;lt;/code&amp;gt;. The result will be provided in the same scale. If no scale is provided, the Fahrenheit scale will be used.&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the due temperature for a given temperature and relative humidity&lt;br /&gt;
&lt;br /&gt;
==fahrenheit==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' fahrenheit(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts a temperature value from Celsius to Fahrenheit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Dynamic|Dynamic]] =&lt;br /&gt;
;if(condition, valueIfTrue, valueIfFalse)&lt;br /&gt;
:evaluates a boolean and returns value1 if true, or value2 otherwise&lt;br /&gt;
;least(values)&lt;br /&gt;
:returns the value that is least found a series of numeric values&lt;br /&gt;
;most(values)&lt;br /&gt;
:returns the value that is most found a series of numeric values&lt;br /&gt;
;previousValue([device;attribute])&lt;br /&gt;
:returns the previous value of the attribute&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Number_.28Integer.29|Integers]] =&lt;br /&gt;
;age([device﹕attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the current value&lt;br /&gt;
;count(values)&lt;br /&gt;
:calculates the number of true/non-zero/non-empty items in a series of numeric values&lt;br /&gt;
;int()&lt;br /&gt;
://todo&lt;br /&gt;
;integer(decimal or string)&lt;br /&gt;
:converts a decimal value to it's integer value&lt;br /&gt;
;newer([device﹕attribute],[...], [device﹕attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for less than the specified number of milliseconds&lt;br /&gt;
;older([device﹕attribute],[...], [device﹕attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for more than the specified number of milliseconds&lt;br /&gt;
;previousAge([device﹕attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the previous value&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Time|Time]] =&lt;br /&gt;
;time(value)&lt;br /&gt;
:returns the value as a time type&lt;br /&gt;
;addSeconds(dateTime, seconds)&lt;br /&gt;
:adds seconds to time, returns the value as a time type&lt;br /&gt;
;addMinutes(dateTime, minutes)&lt;br /&gt;
:adds minutes to time, returns the value as a time type&lt;br /&gt;
;addHours(dateTime, hours)&lt;br /&gt;
:adds hours to time, returns the value as a time type&lt;br /&gt;
;addDays(dateTime, days)&lt;br /&gt;
:adds days to time, returns the value as a time type&lt;br /&gt;
;addWeeks(dateTime, weeks)&lt;br /&gt;
:adds weeks to time, returns the value as a time type&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=Functions&amp;diff=514</id>
		<title>Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=Functions&amp;diff=514"/>
				<updated>2017-07-17T20:23:08Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Add abs(value)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: left; clear: both; margin-right: 1em; margin-bottom: 1em;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
Functions are extensions to expressions that allow data processing and conversion. Here is a list of all defined functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#String|String]] functions=&lt;br /&gt;
&lt;br /&gt;
==concat==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' concat(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that is the concatenation of all the supplied values. This function accepts two or more input values.&lt;br /&gt;
&lt;br /&gt;
==contains==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' contains(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; is found anywhere in the &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==endsWith==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' endsWith(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; ends with the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==format==&lt;br /&gt;
[[File:Format.pdf|page=1|thumb|256px|A very nice article written by Professor Don Colton, at the Brigham Young University of Hawaii]]&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' format(''string'' formatString[, ''dynamic'' value1[, .., ''dynamic'' valueN]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that is built based on the &amp;lt;code&amp;gt;formatString&amp;lt;/code&amp;gt; with arguments replaced by their corresponding values. Follows the java syntax for &amp;lt;code&amp;gt;printf()&amp;lt;/code&amp;gt;. See a quick reference [https://www.cs.colostate.edu/~cs160/.Summer16/resources/Java_printf_method_quick_reference.pdf here], or a more detailed reference [https://sharkysoft.com/archive/printf/docs/javadocs/lava/clib/stdio/doc-files/specification.htm Reference here].&lt;br /&gt;
::Each % in the format string represents an argument and corresponds to a value (in order of appearance) in the value list. Each argument can have formatting settings, according to the reference provided. &lt;br /&gt;
:Example&lt;br /&gt;
::&amp;lt;code&amp;gt;format('The temperature outside is %.2f degrees Fahrenheit', [Temp sensor:temperature])&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;The temperature outside is 71.26 degrees Fahrenheit&amp;lt;/code&amp;gt;&lt;br /&gt;
::The &amp;lt;code&amp;gt;%.2f&amp;lt;/code&amp;gt; translates to &amp;quot;format as &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;loat and use &amp;lt;code&amp;gt;.2&amp;lt;/code&amp;gt; decimal places.&lt;br /&gt;
&lt;br /&gt;
==indexOf==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' indexOf(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the character index of the first occurrence of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;indexOf(&amp;quot;hello world&amp;quot;, 'l')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lastIndexOf==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' lastIndexOf(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the character index of the last occurrence of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lastIndexOf(&amp;quot;hello world&amp;quot;, 'l')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;9&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==left==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' left(''string'' value, ''integer'' length)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the first &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; characters in &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;left(&amp;quot;hello world&amp;quot;, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;he&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lower==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' lower(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but with all lower case letters.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello World&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hello world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==mid==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' mid(''string'' value, ''integer'' start[, ''integer'' count = remaining])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; - provides the 0-based index of the first character to copy. If &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; is negative, the counting starts from the end of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
::&amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; - provides the number of characters to copy from &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. If not provided, all of the remaining characters from &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; are returned, starting with character number &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is negative, prior characters are returned.&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a substring of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; characters long, starting at character number &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;. Note that the first character in any string has index 0.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, 2, 3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;llo&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;llo World&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, -5, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Wo&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, -1, -3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;orl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==random==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' random([''integer'' range | ''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; - an integer number representing a range&lt;br /&gt;
::&amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt;..&amp;lt;code&amp;gt;valueN&amp;lt;/code&amp;gt; - any kind of arguments, one will be randomly returned&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a random decimal number between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; if no arguments are provided, or a number between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; (inclusive) if a single argument is provided, or a randomly selected argument if two or more arguments are provided.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;random()&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;0.483&amp;lt;/code&amp;gt; (random decimal)&lt;br /&gt;
::&amp;lt;code&amp;gt;random(20)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; (random integer)&lt;br /&gt;
::&amp;lt;code&amp;gt;random(&amp;quot;Hello World&amp;quot;, &amp;quot;Good morning&amp;quot;, &amp;quot;Hello&amp;quot;, &amp;quot;Hi&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello&amp;lt;/code&amp;gt; (randomly selected value)&lt;br /&gt;
:Tips&lt;br /&gt;
::To output a random integer between 5 and 20 use &amp;lt;code&amp;gt;(5 + random(15))&amp;lt;/code&amp;gt;&lt;br /&gt;
::To output a random integer between -5 and 20 use &amp;lt;code&amp;gt;(-5 + random(25))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==replace==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' replace(''string'' haystack, ''string'' needle1, ''string'' replacement1[, .., ''string'' needleN, ''string'' replacementN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Replaces all the occurrences of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; with its respective &amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt;. Multiple pairs of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt; can be provided in one function call.&lt;br /&gt;
:Regular expressions&lt;br /&gt;
::Needles support regular expressions when their value starts and ends with a &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;. For example, &amp;lt;code&amp;gt;'/(\s)/'&amp;lt;/code&amp;gt; will match all spaces.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello Earth&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth', 'Hello', 'Hi')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hi Earth&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth', 'Earth', 'Planet')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello Planet&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==right==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' right(''string'' value, ''integer'' length)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the last &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; characters in &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;right(&amp;quot;hello world&amp;quot;, 4)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;orld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==startsWith==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' startsWith(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; starts with the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==string==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' string(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; as a string.&lt;br /&gt;
&lt;br /&gt;
==substr==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;mid()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==substring==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;mid()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==title==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' title(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but in its title case format (each word starts with a capitalized letter).&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello there world&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello There World&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==upper==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' upper(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but with all upper case letters.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;upper(&amp;quot;Hello World&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;HELLO WORLD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==text==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;string()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==trim==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;quot;string&amp;quot; trim(&amp;quot;string&amp;quot; value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with leading and trailing spaces removed&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;trim(&amp;quot; Hello World &amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello World&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==trimLeft==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;quot;string&amp;quot; trimLeft(&amp;quot;string&amp;quot; value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with leading spaces removed&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;trimLeft(&amp;quot; Hello World &amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;&amp;quot;Hello World &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ltrim==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;trimLeft()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==trimRight==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;quot;string&amp;quot; trimRight(&amp;quot;string&amp;quot; value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with trailing spaces removed&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;trimRight(&amp;quot; Hello World &amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;&amp;quot; Hello World&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==rtrim==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;trimRight()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Numeric functions=&lt;br /&gt;
&lt;br /&gt;
==avg==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' avg(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the mean average of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==abs==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' abs(''decimal'' value])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the absolute value of the argument (e.g., remove negative sign for negative values).&lt;br /&gt;
&lt;br /&gt;
==ceil==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' ceil(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the immediately higher integer, equivalent to rounding the decimal away from zero.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;ceil(5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;ceil(-5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;-6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ceiling==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;ceil&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==decimal==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' decimal(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; into a decimal. Returns &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is not numeric.&lt;br /&gt;
&lt;br /&gt;
==float==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;decimal&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==floor==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' ceil(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the integer part of a decimal, equivalent to rounding the decimal towards zero.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;floor(5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;floor(-5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;-5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==max==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' max(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the maximum of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==median==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' median(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the median average of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==min==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' min(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the minimum of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==number==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;decimal&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==power==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' power(''decimal'' value, ''decimal'' exponent)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; at the power of &amp;lt;code&amp;gt;exponent&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==round==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' round(''decimal'' value[, ''integer'' precision = 0])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;precision&amp;lt;/code&amp;gt; - the number of decimal places to be retained. If not provided, defaults to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the rounded &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;precision&amp;lt;/code&amp;gt; decimal places.&lt;br /&gt;
&lt;br /&gt;
==sqr==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sqr(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the squared &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, equivalent to &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; multiplied by itself.&lt;br /&gt;
&lt;br /&gt;
==sqrt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sqrt(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the square root of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==stdev==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' stdev(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the standard deviation of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==sum==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sum(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the sum of sum of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==variance==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' variance(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the variance of all the values provided.&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#Boolean|Boolean]] functions=&lt;br /&gt;
&lt;br /&gt;
==bool==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;bool(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the truth value of the input. Accepts anything as input and will return true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is either a non-zero number, a non-empty string (with some exceptions, see below), a non-empty device list, a non-empty date/time/datetime&lt;br /&gt;
&lt;br /&gt;
==boolean==&lt;br /&gt;
:This is an alias of [[Functions#bool|bool]]&lt;br /&gt;
&lt;br /&gt;
==eq==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;eq(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ge==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;ge(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is greater than or equal to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==gt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;gt(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is greater than &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==isBetween==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;isBetween(''dynamic'' value, ''dynamic'' startValue, ''dynamic'' endValue)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is greater then or equal to &amp;lt;code&amp;gt;startValue&amp;lt;/code&amp;gt; and less than or equal to &amp;lt;code&amp;gt;endValue&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==isEmpty==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;isEmpty(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is not set, an empty string, or zero&lt;br /&gt;
&lt;br /&gt;
==le==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;le(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is less than or equal to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;lt(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is less than &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==not==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;not(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the negated truth state of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. This is the logical negation of &amp;lt;code&amp;gt;[[Functions#bool|bool]](''dynamic'' value)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#Date_and_Time|Date and time]] functions=&lt;br /&gt;
&lt;br /&gt;
==addDays==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addDays(''datetime'' value, ''integer'' days)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; days after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; days before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addHours==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addHours(''datetime'' value, ''integer'' hours)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt; hours after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt; hours before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addMinutes==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addMinutes(''datetime'' value, ''integer'' minutes)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; minutes after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; minutes before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addSeconds==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addSeconds(''datetime'' value, ''integer'' seconds)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; seconds after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; seconds before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addWeeks==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addWeeks(''datetime'' value, ''integer'' weeks)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt; weeks after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt; weeks before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==date==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;date(''datetime'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the date portion of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; by stripping off time information.&lt;br /&gt;
&lt;br /&gt;
==datetime==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''datetime'' datetime(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Tries to convert any value into a datetime. Accepts strings in common date/time formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==formatDuration==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' formatDuration(''datetime'' value[, ''boolean'' friendly = false[, ''string'' granularity = 's'[, ''boolean'' showAdverbs = false]]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;friendly&amp;lt;/code&amp;gt; - &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; makes the output compact, in the form of &amp;lt;code&amp;gt;0d 00:00:00.000&amp;lt;/code&amp;gt;, while &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; makes the output more human friendly, in the form of &amp;lt;code&amp;gt; 0 days, 0 hours, 0 minutes, and 0 seconds&amp;lt;/code&amp;gt;. Defaults to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
::&amp;lt;code&amp;gt;granularity&amp;lt;/code&amp;gt; - represents the smallest time unit to be output. One of &amp;lt;code&amp;gt;d&amp;lt;/code&amp;gt; for days, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; for hours, &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; for minutes, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; for seconds, or &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; for milliseconds. Any time unit below the selected granularity will not be output. Defaults to &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;showAdverbs&amp;lt;/code&amp;gt; - only affects the friendly output, when &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; the words &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; (for future durations - positive input) or &amp;lt;code&amp;gt;ago&amp;lt;/code&amp;gt; (for past durations - negative input) are prepended or appended respectively to the output&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that represents the duration in a human readable format&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(12029)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;00:00:12&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, true)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;1 minute and 8 seconds&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, false, 'ms')&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;00:01:08&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, true, 'm', true)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;in 1 minute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==time==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''time'' time(''datetime'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the time portion of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; by stripping off date information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Weather related functions=&lt;br /&gt;
&lt;br /&gt;
==celsius==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' celsius(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts a temperature value from Fahrenheit to Celsius.&lt;br /&gt;
&lt;br /&gt;
==dewPoint==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' dewPoint(''decimal'' temperature, ''decimal'' relativeHumidity[, ''string'' scale = 'F'])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Parameters&lt;br /&gt;
::&amp;lt;code&amp;gt;scale&amp;lt;/code&amp;gt; - optional, one of &amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt;, corresponding to the temperature range used for &amp;lt;code&amp;gt;temperature&amp;lt;/code&amp;gt;. The result will be provided in the same scale. If no scale is provided, the Fahrenheit scale will be used.&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the due temperature for a given temperature and relative humidity&lt;br /&gt;
&lt;br /&gt;
==fahrenheit==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' fahrenheit(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts a temperature value from Celsius to Fahrenheit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Dynamic|Dynamic]] =&lt;br /&gt;
;if(condition, valueIfTrue, valueIfFalse)&lt;br /&gt;
:evaluates a boolean and returns value1 if true, or value2 otherwise&lt;br /&gt;
;least(values)&lt;br /&gt;
:returns the value that is least found a series of numeric values&lt;br /&gt;
;most(values)&lt;br /&gt;
:returns the value that is most found a series of numeric values&lt;br /&gt;
;previousValue([device;attribute])&lt;br /&gt;
:returns the previous value of the attribute&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Number_.28Integer.29|Integers]] =&lt;br /&gt;
;age([device﹕attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the current value&lt;br /&gt;
;count(values)&lt;br /&gt;
:calculates the number of true/non-zero/non-empty items in a series of numeric values&lt;br /&gt;
;int()&lt;br /&gt;
://todo&lt;br /&gt;
;integer(decimal or string)&lt;br /&gt;
:converts a decimal value to it's integer value&lt;br /&gt;
;newer([device﹕attribute],[...], [device﹕attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for less than the specified number of milliseconds&lt;br /&gt;
;older([device﹕attribute],[...], [device﹕attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for more than the specified number of milliseconds&lt;br /&gt;
;previousAge([device﹕attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the previous value&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Time|Time]] =&lt;br /&gt;
;time(value)&lt;br /&gt;
:returns the value as a time type&lt;br /&gt;
;addSeconds(dateTime, seconds)&lt;br /&gt;
:adds seconds to time, returns the value as a time type&lt;br /&gt;
;addMinutes(dateTime, minutes)&lt;br /&gt;
:adds minutes to time, returns the value as a time type&lt;br /&gt;
;addHours(dateTime, hours)&lt;br /&gt;
:adds hours to time, returns the value as a time type&lt;br /&gt;
;addDays(dateTime, days)&lt;br /&gt;
:adds days to time, returns the value as a time type&lt;br /&gt;
;addWeeks(dateTime, weeks)&lt;br /&gt;
:adds weeks to time, returns the value as a time type&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=Functions&amp;diff=495</id>
		<title>Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=Functions&amp;diff=495"/>
				<updated>2017-06-28T04:38:22Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Add newly supported trim/trimLeft/ltrim/trimRight/rtrim functions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: left; clear: both; margin-right: 1em; margin-bottom: 1em;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
Functions are extensions to expressions that allow data processing and conversion. Here is a list of all defined functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#String|String]] functions=&lt;br /&gt;
&lt;br /&gt;
==concat==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' concat(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that is the concatenation of all the supplied values. This function accepts two or more input values.&lt;br /&gt;
&lt;br /&gt;
==contains==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' contains(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; is found anywhere in the &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==endsWith==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' endsWith(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; ends with the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==format==&lt;br /&gt;
[[File:Format.pdf|page=1|thumb|256px|A very nice article written by Professor Don Colton, at the Brigham Young University of Hawaii]]&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' format(''string'' formatString[, ''dynamic'' value1[, .., ''dynamic'' valueN]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that is built based on the &amp;lt;code&amp;gt;formatString&amp;lt;/code&amp;gt; with arguments replaced by their corresponding values. Follows the java syntax for &amp;lt;code&amp;gt;printf()&amp;lt;/code&amp;gt;. See a quick reference [https://www.cs.colostate.edu/~cs160/.Summer16/resources/Java_printf_method_quick_reference.pdf here], or a more detailed reference [https://sharkysoft.com/archive/printf/docs/javadocs/lava/clib/stdio/doc-files/specification.htm Reference here].&lt;br /&gt;
::Each % in the format string represents an argument and corresponds to a value (in order of appearance) in the value list. Each argument can have formatting settings, according to the reference provided. &lt;br /&gt;
:Example&lt;br /&gt;
::&amp;lt;code&amp;gt;format('The temperature outside is %.2f degrees Fahrenheit', [Temp sensor:temperature])&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;The temperature outside is 71.26 degrees Fahrenheit&amp;lt;/code&amp;gt;&lt;br /&gt;
::The &amp;lt;code&amp;gt;%.2f&amp;lt;/code&amp;gt; translates to &amp;quot;format as &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;loat and use &amp;lt;code&amp;gt;.2&amp;lt;/code&amp;gt; decimal places.&lt;br /&gt;
&lt;br /&gt;
==indexOf==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' indexOf(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the character index of the first occurrence of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;indexOf(&amp;quot;hello world&amp;quot;, 'l')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lastIndexOf==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' lastIndexOf(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the character index of the last occurrence of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lastIndexOf(&amp;quot;hello world&amp;quot;, 'l')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;9&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==left==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' left(''string'' value, ''integer'' length)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the first &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; characters in &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;left(&amp;quot;hello world&amp;quot;, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;he&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lower==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' lower(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but with all lower case letters.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello World&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hello world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==mid==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' mid(''string'' value, ''integer'' start[, ''integer'' count = remaining])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; - provides the 0-based index of the first character to copy. If &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; is negative, the counting starts from the end of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
::&amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; - provides the number of characters to copy from &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. If not provided, all of the remaining characters from &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; are returned, starting with character number &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is negative, prior characters are returned.&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a substring of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; characters long, starting at character number &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;. Note that the first character in any string has index 0.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, 2, 3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;llo&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;llo World&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, -5, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Wo&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, -1, -3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;orl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==random==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' random([''integer'' range | ''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; - an integer number representing a range&lt;br /&gt;
::&amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt;..&amp;lt;code&amp;gt;valueN&amp;lt;/code&amp;gt; - any kind of arguments, one will be randomly returned&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a random decimal number between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; if no arguments are provided, or a number between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; (inclusive) if a single argument is provided, or a randomly selected argument if two or more arguments are provided.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;random()&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;0.483&amp;lt;/code&amp;gt; (random decimal)&lt;br /&gt;
::&amp;lt;code&amp;gt;random(20)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; (random integer)&lt;br /&gt;
::&amp;lt;code&amp;gt;random(&amp;quot;Hello World&amp;quot;, &amp;quot;Good morning&amp;quot;, &amp;quot;Hello&amp;quot;, &amp;quot;Hi&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello&amp;lt;/code&amp;gt; (randomly selected value)&lt;br /&gt;
:Tips&lt;br /&gt;
::To output a random integer between 5 and 20 use &amp;lt;code&amp;gt;(5 + random(15))&amp;lt;/code&amp;gt;&lt;br /&gt;
::To output a random integer between -5 and 20 use &amp;lt;code&amp;gt;(-5 + random(25))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==replace==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' replace(''string'' haystack, ''string'' needle1, ''string'' replacement1[, .., ''string'' needleN, ''string'' replacementN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Replaces all the occurrences of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; with its respective &amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt;. Multiple pairs of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt; can be provided in one function call.&lt;br /&gt;
:Regular expressions&lt;br /&gt;
::Needles support regular expressions when their value starts and ends with a &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;. For example, &amp;lt;code&amp;gt;'/(\s)/'&amp;lt;/code&amp;gt; will match all spaces.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello Earth&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth', 'Hello', 'Hi')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hi Earth&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth', 'Earth', 'Planet')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello Planet&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==right==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' right(''string'' value, ''integer'' length)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the last &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; characters in &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;right(&amp;quot;hello world&amp;quot;, 4)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;orld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==startsWith==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' startsWith(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; starts with the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==string==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' string(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; as a string.&lt;br /&gt;
&lt;br /&gt;
==substr==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;mid()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==substring==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;mid()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==title==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' title(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but in its title case format (each word starts with a capitalized letter).&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello there world&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello There World&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==upper==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' upper(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but with all upper case letters.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;upper(&amp;quot;Hello World&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;HELLO WORLD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==text==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;string()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==trim==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;quot;string&amp;quot; trim(&amp;quot;string&amp;quot; value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with leading and trailing spaces removed&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;trim(&amp;quot; Hello World &amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello World&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==trimLeft==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;quot;string&amp;quot; trimLeft(&amp;quot;string&amp;quot; value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with leading spaces removed&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;trimLeft(&amp;quot; Hello World &amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;&amp;quot;Hello World &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ltrim==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;trimLeft()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==trimRight==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;quot;string&amp;quot; trimRight(&amp;quot;string&amp;quot; value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with trailing spaces removed&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;trimRight(&amp;quot; Hello World &amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;&amp;quot; Hello World&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==rtrim==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;trimRight()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Numeric functions=&lt;br /&gt;
&lt;br /&gt;
==avg==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' avg(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the mean average of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==ceil==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' ceil(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the immediately higher integer, equivalent to rounding the decimal away from zero.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;ceil(5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;ceil(-5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;-6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ceiling==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;ceil&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==decimal==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' decimal(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; into a decimal. Returns &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is not numeric.&lt;br /&gt;
&lt;br /&gt;
==float==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;decimal&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==floor==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' ceil(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the integer part of a decimal, equivalent to rounding the decimal towards zero.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;floor(5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;floor(-5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;-5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==max==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' max(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the maximum of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==median==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' median(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the median average of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==min==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' min(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the minimum of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==number==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;decimal&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==power==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' power(''decimal'' value, ''decimal'' exponent)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; at the power of &amp;lt;code&amp;gt;exponent&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==round==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' round(''decimal'' value[, ''integer'' precision = 0])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;precision&amp;lt;/code&amp;gt; - the number of decimal places to be retained. If not provided, defaults to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the rounded &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;precision&amp;lt;/code&amp;gt; decimal places.&lt;br /&gt;
&lt;br /&gt;
==sqr==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sqr(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the squared &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, equivalent to &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; multiplied by itself.&lt;br /&gt;
&lt;br /&gt;
==sqrt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sqrt(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the square root of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==stdev==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' stdev(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the standard deviation of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==sum==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sum(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the sum of sum of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==variance==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' variance(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the variance of all the values provided.&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#Boolean|Boolean]] functions=&lt;br /&gt;
&lt;br /&gt;
==bool==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;bool(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the truth value of the input. Accepts anything as input and will return true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is either a non-zero number, a non-empty string (with some exceptions, see below), a non-empty device list, a non-empty date/time/datetime&lt;br /&gt;
&lt;br /&gt;
==boolean==&lt;br /&gt;
:This is an alias of [[Functions#bool|bool]]&lt;br /&gt;
&lt;br /&gt;
==eq==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;eq(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ge==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;ge(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is greater than or equal to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==gt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;gt(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is greater than &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==isBetween==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;isBetween(''dynamic'' value, ''dynamic'' startValue, ''dynamic'' endValue)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is greater then or equal to &amp;lt;code&amp;gt;startValue&amp;lt;/code&amp;gt; and less than or equal to &amp;lt;code&amp;gt;endValue&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==isEmpty==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;isEmpty(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is not set, an empty string, or zero&lt;br /&gt;
&lt;br /&gt;
==le==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;le(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is less than or equal to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;lt(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is less than &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==not==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;not(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the negated truth state of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. This is the logical negation of &amp;lt;code&amp;gt;[[Functions#bool|bool]](''dynamic'' value)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#Date_and_Time|Date and time]] functions=&lt;br /&gt;
&lt;br /&gt;
==addDays==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addDays(''datetime'' value, ''integer'' days)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; days after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; days before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addHours==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addHours(''datetime'' value, ''integer'' hours)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt; hours after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt; hours before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addMinutes==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addMinutes(''datetime'' value, ''integer'' minutes)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; minutes after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; minutes before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addSeconds==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addSeconds(''datetime'' value, ''integer'' seconds)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; seconds after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; seconds before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addWeeks==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addWeeks(''datetime'' value, ''integer'' weeks)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt; weeks after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt; weeks before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==date==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;date(''datetime'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the date portion of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; by stripping off time information.&lt;br /&gt;
&lt;br /&gt;
==datetime==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''datetime'' datetime(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Tries to convert any value into a datetime. Accepts strings in common date/time formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==formatDuration==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' formatDuration(''datetime'' value[, ''boolean'' friendly = false[, ''string'' granularity = 's'[, ''boolean'' showAdverbs = false]]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;friendly&amp;lt;/code&amp;gt; - &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; makes the output compact, in the form of &amp;lt;code&amp;gt;0d 00:00:00.000&amp;lt;/code&amp;gt;, while &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; makes the output more human friendly, in the form of &amp;lt;code&amp;gt; 0 days, 0 hours, 0 minutes, and 0 seconds&amp;lt;/code&amp;gt;. Defaults to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
::&amp;lt;code&amp;gt;granularity&amp;lt;/code&amp;gt; - represents the smallest time unit to be output. One of &amp;lt;code&amp;gt;d&amp;lt;/code&amp;gt; for days, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; for hours, &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; for minutes, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; for seconds, or &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; for milliseconds. Any time unit below the selected granularity will not be output. Defaults to &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;showAdverbs&amp;lt;/code&amp;gt; - only affects the friendly output, when &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; the words &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; (for future durations - positive input) or &amp;lt;code&amp;gt;ago&amp;lt;/code&amp;gt; (for past durations - negative input) are prepended or appended respectively to the output&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that represents the duration in a human readable format&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(12029)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;00:00:12&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, true)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;1 minute and 8 seconds&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, false, 'ms')&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;00:01:08&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, true, 'm', true)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;in 1 minute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==time==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''time'' time(''datetime'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the time portion of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; by stripping off date information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Weather related functions=&lt;br /&gt;
&lt;br /&gt;
==celsius==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' celsius(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts a temperature value from Fahrenheit to Celsius.&lt;br /&gt;
&lt;br /&gt;
==dewPoint==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' dewPoint(''decimal'' temperature, ''decimal'' relativeHumidity[, ''string'' scale = 'F'])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Parameters&lt;br /&gt;
::&amp;lt;code&amp;gt;scale&amp;lt;/code&amp;gt; - optional, one of &amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt;, corresponding to the temperature range used for &amp;lt;code&amp;gt;temperature&amp;lt;/code&amp;gt;. The result will be provided in the same scale. If no scale is provided, the Fahrenheit scale will be used.&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the due temperature for a given temperature and relative humidity&lt;br /&gt;
&lt;br /&gt;
==fahrenheit==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' fahrenheit(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts a temperature value from Celsius to Fahrenheit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Dynamic|Dynamic]] =&lt;br /&gt;
;if(condition, valueIfTrue, valueIfFalse)&lt;br /&gt;
:evaluates a boolean and returns value1 if true, or value2 otherwise&lt;br /&gt;
;least(values)&lt;br /&gt;
:returns the value that is least found a series of numeric values&lt;br /&gt;
;most(values)&lt;br /&gt;
:returns the value that is most found a series of numeric values&lt;br /&gt;
;previousValue([device;attribute])&lt;br /&gt;
:returns the previous value of the attribute&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Number_.28Integer.29|Integers]] =&lt;br /&gt;
;age([device﹕attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the current value&lt;br /&gt;
;count(values)&lt;br /&gt;
:calculates the number of true/non-zero/non-empty items in a series of numeric values&lt;br /&gt;
;int()&lt;br /&gt;
://todo&lt;br /&gt;
;integer(decimal or string)&lt;br /&gt;
:converts a decimal value to it's integer value&lt;br /&gt;
;newer([device﹕attribute],[...], [device﹕attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for less than the specified number of milliseconds&lt;br /&gt;
;older([device﹕attribute],[...], [device﹕attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for more than the specified number of milliseconds&lt;br /&gt;
;previousAge([device﹕attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the previous value&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Time|Time]] =&lt;br /&gt;
;time(value)&lt;br /&gt;
:returns the value as a time type&lt;br /&gt;
;addSeconds(dateTime, seconds)&lt;br /&gt;
:adds seconds to time, returns the value as a time type&lt;br /&gt;
;addMinutes(dateTime, minutes)&lt;br /&gt;
:adds minutes to time, returns the value as a time type&lt;br /&gt;
;addHours(dateTime, hours)&lt;br /&gt;
:adds hours to time, returns the value as a time type&lt;br /&gt;
;addDays(dateTime, days)&lt;br /&gt;
:adds days to time, returns the value as a time type&lt;br /&gt;
;addWeeks(dateTime, weeks)&lt;br /&gt;
:adds weeks to time, returns the value as a time type&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=User_talk:Ahndee&amp;diff=443</id>
		<title>User talk:Ahndee</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=User_talk:Ahndee&amp;diff=443"/>
				<updated>2017-05-16T05:20:29Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=Functions&amp;diff=342</id>
		<title>Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=Functions&amp;diff=342"/>
				<updated>2017-05-07T23:53:17Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: /* Integers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: right; clear: both; margin-left: 1em; margin-bottom: 1em;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
Functions are extensions to expressions that allow data processing and conversion. Here is a list of all defined functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#String|String]] functions=&lt;br /&gt;
&lt;br /&gt;
==concat==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' concat(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that is the concatenation of all the supplied values. This function accepts two or more input values.&lt;br /&gt;
&lt;br /&gt;
==contains==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' contains(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; is found anywhere in the &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==endsWith==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' endsWith(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; ends with the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==format==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' format(''string'' formatString[, ''dynamic'' value1[, .., ''dynamic'' valueN]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that is built based on the &amp;lt;code&amp;gt;formatString&amp;lt;/code&amp;gt; with arguments replaced by their corresponding values. Follows the java syntax for &amp;lt;code&amp;gt;printf()&amp;lt;/code&amp;gt;. See a quick reference [https://www.cs.colostate.edu/~cs160/.Summer16/resources/Java_printf_method_quick_reference.pdf here], or a more detailed reference [https://sharkysoft.com/archive/printf/docs/javadocs/lava/clib/stdio/doc-files/specification.htm Reference here].&lt;br /&gt;
::Each % in the format string represents an argument and corresponds to a value (in order of appearance) in the value list. Each argument can have formatting settings, according to the reference provided. &lt;br /&gt;
:Example&lt;br /&gt;
::&amp;lt;code&amp;gt;format('The temperature outside is %.2f degrees Fahrenheit', [Temp sensor:temperature])&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;The temperature outside is 71.26 degrees Fahrenheit&amp;lt;/code&amp;gt;&lt;br /&gt;
::The &amp;lt;code&amp;gt;%.2f&amp;lt;/code&amp;gt; translates to &amp;quot;format as &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;loat and use &amp;lt;code&amp;gt;.2&amp;lt;/code&amp;gt; decimal places.&lt;br /&gt;
&lt;br /&gt;
==indexOf==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' indexOf(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the character index of the first occurrence of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;indexOf(&amp;quot;hello world&amp;quot;, 'l')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lastIndexOf==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' lastIndexOf(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the character index of the last occurrence of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lastIndexOf(&amp;quot;hello world&amp;quot;, 'l')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;9&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==left==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' left(''string'' value, ''integer'' length)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the first &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; characters in &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;left(&amp;quot;hello world&amp;quot;, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;he&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lower==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' lower(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but with all lower case letters.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello World&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hello world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==mid==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' mid(''string'' value, ''integer'' start[, ''integer'' count = remaining])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; - provides the 0-based index of the first character to copy. If &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; is negative, the counting starts from the end of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
::&amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; - provides the number of characters to copy from &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. If not provided, all of the remaining characters from &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; are returned, starting with character number &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is negative, prior characters are returned.&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a substring of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; characters long, starting at character number &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;. Note that the first character in any string has index 0.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, 2, 3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;llo&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;llo World&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, -5, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Wo&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, -1, -3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;orl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==random==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' random([''integer'' range | ''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; - an integer number representing a range&lt;br /&gt;
::&amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt;..&amp;lt;code&amp;gt;valueN&amp;lt;/code&amp;gt; - any kind of arguments, one will be randomly returned&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a random decimal number between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; if no arguments are provided, or a number between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; (inclusive) if a single argument is provided, or a randomly selected argument if two or more arguments are provided.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;random()&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;0.483&amp;lt;/code&amp;gt; (random decimal)&lt;br /&gt;
::&amp;lt;code&amp;gt;random(20)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; (random integer)&lt;br /&gt;
::&amp;lt;code&amp;gt;random(&amp;quot;Hello World&amp;quot;, &amp;quot;Good morning&amp;quot;, &amp;quot;Hello&amp;quot;, &amp;quot;Hi&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello&amp;lt;/code&amp;gt; (randomly selected value)&lt;br /&gt;
&lt;br /&gt;
==replace==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' replace(''string'' haystack, ''string'' needle1, ''string'' replacement1[, .., ''string'' needleN, ''string'' replacementN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Replaces all the occurrences of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; with its respective &amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt;. Multiple pairs of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt; can be provided in one function call.&lt;br /&gt;
:Regular expressions&lt;br /&gt;
::Needles support regular expressions when their value starts and ends with a &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;. For example, &amp;lt;code&amp;gt;'/(\s)/'&amp;lt;/code&amp;gt; will match all spaces.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello Earth&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth', 'Hello', 'Hi')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hi Earth&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth', 'Earth', 'Planet')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello Planet&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==right==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' right(''string'' value, ''integer'' length)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the last &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; characters in &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;right(&amp;quot;hello world&amp;quot;, 4)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;orld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==startsWith==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' startsWith(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; starts with the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==string==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' string(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; as a string.&lt;br /&gt;
&lt;br /&gt;
==substr==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;mid()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==substring==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;mid()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==title==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' title(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but in its title case format (each word starts with a capitalized letter).&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello there world&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello There World&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==upper==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' upper(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but with all upper case letters.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello World&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;HELLO WORLD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==text==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;string()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Numeric functions=&lt;br /&gt;
&lt;br /&gt;
==avg==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' avg(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the mean average of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==ceil==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' ceil(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the immediately higher integer, equivalent to rounding the decimal away from zero.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;ceil(5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;ceil(-5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;-6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ceiling==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;ceil&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==decimal==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' decimal(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; into a decimal. Returns &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is not numeric.&lt;br /&gt;
&lt;br /&gt;
==float==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;decimal&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==floor==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' ceil(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the integer part of a decimal, equivalent to rounding the decimal towards zero.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;floor(5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;floor(-5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;-5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==max==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' max(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the maximum of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==median==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' median(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the median average of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==min==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' min(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the minimum of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==number==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;decimal&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==power==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' power(''decimal'' value, ''decimal'' exponent)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; at the power of &amp;lt;code&amp;gt;exponent&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==round==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' round(''decimal'' value[, ''integer'' precision = 0])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;precision&amp;lt;/code&amp;gt; - the number of decimal places to be retained. If not provided, defaults to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the rounded &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;precision&amp;lt;/code&amp;gt; decimal places.&lt;br /&gt;
&lt;br /&gt;
==sqr==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sqr(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the squared &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, equivalent to &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; multiplied by itself.&lt;br /&gt;
&lt;br /&gt;
==sqrt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sqrt(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the square root of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==stdev==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' stdev(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the standard deviation of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==sum==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sum(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the sum of sum of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==variance==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' variance(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the variance of all the values provided.&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#Boolean|Boolean]] functions=&lt;br /&gt;
&lt;br /&gt;
==bool==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;bool(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the truth value of the input. Accepts anything as input and will return true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is either a non-zero number, a non-empty string (with some exceptions, see below), a non-empty device list, a non-empty date/time/datetime&lt;br /&gt;
&lt;br /&gt;
==boolean==&lt;br /&gt;
:This is an alias of [[Functions#bool|bool]]&lt;br /&gt;
&lt;br /&gt;
==eq==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;eq(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ge==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;ge(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is greater than or equal to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==gt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;gt(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is greater than &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==isBetween==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;isBetween(''dynamic'' value, ''dynamic'' startValue, ''dynamic'' endValue)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is greater then or equal to &amp;lt;code&amp;gt;startValue&amp;lt;/code&amp;gt; and less than or equal to &amp;lt;code&amp;gt;endValue&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==isEmpty==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;isEmpty(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is not set, an empty string, or zero&lt;br /&gt;
&lt;br /&gt;
==le==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;le(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is less than or equal to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;lt(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is less than &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==not==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;not(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the negated truth state of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. This is the logical negation of &amp;lt;code&amp;gt;[[Functions#bool|bool]](''dynamic'' value)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#Date_and_Time|Date and time]] functions=&lt;br /&gt;
&lt;br /&gt;
==addDays==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addDays(''datetime'' value, ''integer'' days)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; days after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; days before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addHours==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addHours(''datetime'' value, ''integer'' hours)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt; hours after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt; hours before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addMinutes==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addMinutes(''datetime'' value, ''integer'' minutes)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; minutes after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; minutes before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addSeconds==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addSeconds(''datetime'' value, ''integer'' seconds)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; seconds after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; seconds before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addWeeks==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addWeeks(''datetime'' value, ''integer'' weeks)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt; weeks after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt; weeks before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==date==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;date(''datetime'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the date portion of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; by stripping off time information.&lt;br /&gt;
&lt;br /&gt;
==datetime==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''datetime'' datetime(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Tries to convert any value into a datetime. Accepts strings in common date/time formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==formatDuration==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' formatDuration(''datetime'' value[, ''boolean'' friendly = false[, ''string'' granularity = 's'[, ''boolean'' showAdverbs = false]]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;friendly&amp;lt;/code&amp;gt; - &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; makes the output compact, in the form of &amp;lt;code&amp;gt;0d 00:00:00.000&amp;lt;/code&amp;gt;, while &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; makes the output more human friendly, in the form of &amp;lt;code&amp;gt; 0 days, 0 hours, 0 minutes, and 0 seconds&amp;lt;/code&amp;gt;. Defaults to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
::&amp;lt;code&amp;gt;granularity&amp;lt;/code&amp;gt; - represents the smallest time unit to be output. One of &amp;lt;code&amp;gt;d&amp;lt;/code&amp;gt; for days, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; for hours, &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; for minutes, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; for seconds, or &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; for milliseconds. Any time unit below the selected granularity will not be output. Defaults to &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;showAdverbs&amp;lt;/code&amp;gt; - only affects the friendly output, when &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; the words &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; (for future durations - positive input) or &amp;lt;code&amp;gt;ago&amp;lt;/code&amp;gt; (for past durations - negative input) are prepended or appended respectively to the output&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that represents the duration in a human readable format&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(12029)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;00:00:12&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, true)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;1 minute and 8 seconds&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, false, 'ms')&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;00:01:08&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, true, 'm', true)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;in 1 minute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==time==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''time'' time(''datetime'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the time portion of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; by stripping off date information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Weather related functions=&lt;br /&gt;
&lt;br /&gt;
==celsius==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' celsius(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts a temperature value from Fahrenheit to Celsius.&lt;br /&gt;
&lt;br /&gt;
==dewPoint==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' dewPoint(''decimal'' temperature, ''decimal'' relativeHumidity[, ''string'' scale = 'F'])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Parameters&lt;br /&gt;
::&amp;lt;code&amp;gt;scale&amp;lt;/code&amp;gt; - optional, one of &amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt;, corresponding to the temperature range used for &amp;lt;code&amp;gt;temperature&amp;lt;/code&amp;gt;. The result will be provided in the same scale. If no scale is provided, the Fahrenheit scale will be used.&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the due temperature for a given temperature and relative humidity&lt;br /&gt;
&lt;br /&gt;
==fahrenheit==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' fahrenheit(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts a temperature value from Celsius to Fahrenheit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Dynamic|Dynamic]] =&lt;br /&gt;
;if(condition, valueIfTrue, valueIfFalse)&lt;br /&gt;
:evaluates a boolean and returns value1 if true, or value2 otherwise&lt;br /&gt;
;least(values)&lt;br /&gt;
:returns the value that is least found a series of numeric values&lt;br /&gt;
;most(values)&lt;br /&gt;
:returns the value that is most found a series of numeric values&lt;br /&gt;
;previousValue([device;attribute])&lt;br /&gt;
:returns the previous value of the attribute&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Number_.28Integer.29|Integers]] =&lt;br /&gt;
;age([device﹕attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the current value&lt;br /&gt;
;count(values)&lt;br /&gt;
:calculates the number of true/non-zero/non-empty items in a series of numeric values&lt;br /&gt;
;int()&lt;br /&gt;
://todo&lt;br /&gt;
;integer(decimal or string)&lt;br /&gt;
:converts a decimal value to it's integer value&lt;br /&gt;
;newer([device﹕attribute],[...], [device﹕attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for less than the specified number of milliseconds&lt;br /&gt;
;older([device﹕attribute],[...], [device﹕attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for more than the specified number of milliseconds&lt;br /&gt;
;previousAge([device﹕attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the previous value&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Time|Time]] =&lt;br /&gt;
;time(value)&lt;br /&gt;
:returns the value as a time type&lt;br /&gt;
;addSeconds(dateTime, seconds)&lt;br /&gt;
:adds seconds to time, returns the value as a time type&lt;br /&gt;
;addMinutes(dateTime, minutes)&lt;br /&gt;
:adds minutes to time, returns the value as a time type&lt;br /&gt;
;addHours(dateTime, hours)&lt;br /&gt;
:adds hours to time, returns the value as a time type&lt;br /&gt;
;addDays(dateTime, days)&lt;br /&gt;
:adds days to time, returns the value as a time type&lt;br /&gt;
;addWeeks(dateTime, weeks)&lt;br /&gt;
:adds weeks to time, returns the value as a time type&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=Functions&amp;diff=341</id>
		<title>Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=Functions&amp;diff=341"/>
				<updated>2017-05-07T23:49:08Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: /* Integers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: right; clear: both; margin-left: 1em; margin-bottom: 1em;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
Functions are extensions to expressions that allow data processing and conversion. Here is a list of all defined functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#String|String]] functions=&lt;br /&gt;
&lt;br /&gt;
==concat==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' concat(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that is the concatenation of all the supplied values. This function accepts two or more input values.&lt;br /&gt;
&lt;br /&gt;
==contains==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' contains(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; is found anywhere in the &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==endsWith==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' endsWith(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; ends with the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==format==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' format(''string'' formatString[, ''dynamic'' value1[, .., ''dynamic'' valueN]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that is built based on the &amp;lt;code&amp;gt;formatString&amp;lt;/code&amp;gt; with arguments replaced by their corresponding values. Follows the java syntax for &amp;lt;code&amp;gt;printf()&amp;lt;/code&amp;gt;. See a quick reference [https://www.cs.colostate.edu/~cs160/.Summer16/resources/Java_printf_method_quick_reference.pdf here], or a more detailed reference [https://sharkysoft.com/archive/printf/docs/javadocs/lava/clib/stdio/doc-files/specification.htm Reference here].&lt;br /&gt;
::Each % in the format string represents an argument and corresponds to a value (in order of appearance) in the value list. Each argument can have formatting settings, according to the reference provided. &lt;br /&gt;
:Example&lt;br /&gt;
::&amp;lt;code&amp;gt;format('The temperature outside is %.2f degrees Fahrenheit', [Temp sensor:temperature])&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;The temperature outside is 71.26 degrees Fahrenheit&amp;lt;/code&amp;gt;&lt;br /&gt;
::The &amp;lt;code&amp;gt;%.2f&amp;lt;/code&amp;gt; translates to &amp;quot;format as &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;loat and use &amp;lt;code&amp;gt;.2&amp;lt;/code&amp;gt; decimal places.&lt;br /&gt;
&lt;br /&gt;
==indexOf==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' indexOf(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the character index of the first occurrence of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;indexOf(&amp;quot;hello world&amp;quot;, 'l')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lastIndexOf==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' lastIndexOf(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the character index of the last occurrence of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lastIndexOf(&amp;quot;hello world&amp;quot;, 'l')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;9&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==left==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' left(''string'' value, ''integer'' length)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the first &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; characters in &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;left(&amp;quot;hello world&amp;quot;, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;he&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lower==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' lower(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but with all lower case letters.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello World&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hello world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==mid==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' mid(''string'' value, ''integer'' start[, ''integer'' count = remaining])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; - provides the 0-based index of the first character to copy. If &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; is negative, the counting starts from the end of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
::&amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; - provides the number of characters to copy from &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. If not provided, all of the remaining characters from &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; are returned, starting with character number &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is negative, prior characters are returned.&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a substring of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; characters long, starting at character number &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;. Note that the first character in any string has index 0.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, 2, 3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;llo&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;llo World&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, -5, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Wo&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, -1, -3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;orl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==random==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' random([''integer'' range | ''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; - an integer number representing a range&lt;br /&gt;
::&amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt;..&amp;lt;code&amp;gt;valueN&amp;lt;/code&amp;gt; - any kind of arguments, one will be randomly returned&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a random decimal number between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; if no arguments are provided, or a number between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;range&amp;lt;/code&amp;gt; (inclusive) if a single argument is provided, or a randomly selected argument if two or more arguments are provided.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;random()&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;0.483&amp;lt;/code&amp;gt; (random decimal)&lt;br /&gt;
::&amp;lt;code&amp;gt;random(20)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; (random integer)&lt;br /&gt;
::&amp;lt;code&amp;gt;random(&amp;quot;Hello World&amp;quot;, &amp;quot;Good morning&amp;quot;, &amp;quot;Hello&amp;quot;, &amp;quot;Hi&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello&amp;lt;/code&amp;gt; (randomly selected value)&lt;br /&gt;
&lt;br /&gt;
==replace==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' replace(''string'' haystack, ''string'' needle1, ''string'' replacement1[, .., ''string'' needleN, ''string'' replacementN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Replaces all the occurrences of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; with its respective &amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt;. Multiple pairs of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt; can be provided in one function call.&lt;br /&gt;
:Regular expressions&lt;br /&gt;
::Needles support regular expressions when their value starts and ends with a &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;. For example, &amp;lt;code&amp;gt;'/(\s)/'&amp;lt;/code&amp;gt; will match all spaces.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello Earth&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth', 'Hello', 'Hi')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hi Earth&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth', 'Earth', 'Planet')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello Planet&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==right==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' right(''string'' value, ''integer'' length)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the last &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; characters in &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;right(&amp;quot;hello world&amp;quot;, 4)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;orld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==startsWith==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' startsWith(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; starts with the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==string==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' string(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; as a string.&lt;br /&gt;
&lt;br /&gt;
==substr==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;mid()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==substring==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;mid()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==title==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' title(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but in its title case format (each word starts with a capitalized letter).&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello there world&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello There World&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==upper==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' upper(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but with all upper case letters.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello World&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;HELLO WORLD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==text==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;string()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Numeric functions=&lt;br /&gt;
&lt;br /&gt;
==avg==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' avg(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the mean average of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==ceil==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' ceil(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the immediately higher integer, equivalent to rounding the decimal away from zero.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;ceil(5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;ceil(-5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;-6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ceiling==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;ceil&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==decimal==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' decimal(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; into a decimal. Returns &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is not numeric.&lt;br /&gt;
&lt;br /&gt;
==float==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;decimal&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==floor==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' ceil(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the integer part of a decimal, equivalent to rounding the decimal towards zero.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;floor(5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;floor(-5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;-5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==max==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' max(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the maximum of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==median==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' median(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the median average of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==min==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' min(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the minimum of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==number==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;decimal&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==power==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' power(''decimal'' value, ''decimal'' exponent)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; at the power of &amp;lt;code&amp;gt;exponent&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==round==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' round(''decimal'' value[, ''integer'' precision = 0])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;precision&amp;lt;/code&amp;gt; - the number of decimal places to be retained. If not provided, defaults to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the rounded &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;precision&amp;lt;/code&amp;gt; decimal places.&lt;br /&gt;
&lt;br /&gt;
==sqr==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sqr(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the squared &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, equivalent to &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; multiplied by itself.&lt;br /&gt;
&lt;br /&gt;
==sqrt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sqrt(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the square root of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==stdev==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' stdev(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the standard deviation of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==sum==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sum(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the sum of sum of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==variance==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' variance(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the variance of all the values provided.&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#Boolean|Boolean]] functions=&lt;br /&gt;
&lt;br /&gt;
==bool==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;bool(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the truth value of the input. Accepts anything as input and will return true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is either a non-zero number, a non-empty string (with some exceptions, see below), a non-empty device list, a non-empty date/time/datetime&lt;br /&gt;
&lt;br /&gt;
==boolean==&lt;br /&gt;
:This is an alias of [[Functions#bool|bool]]&lt;br /&gt;
&lt;br /&gt;
==eq==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;eq(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ge==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;ge(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is greater than or equal to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==gt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;gt(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is greater than &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==isBetween==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;isBetween(''dynamic'' value, ''dynamic'' startValue, ''dynamic'' endValue)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is greater then or equal to &amp;lt;code&amp;gt;startValue&amp;lt;/code&amp;gt; and less than or equal to &amp;lt;code&amp;gt;endValue&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==isEmpty==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;isEmpty(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is not set, an empty string, or zero&lt;br /&gt;
&lt;br /&gt;
==le==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;le(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is less than or equal to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;lt(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is less than &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==not==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;not(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the negated truth state of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. This is the logical negation of &amp;lt;code&amp;gt;[[Functions#bool|bool]](''dynamic'' value)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#Date_and_Time|Date and time]] functions=&lt;br /&gt;
&lt;br /&gt;
==addDays==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addDays(''datetime'' value, ''integer'' days)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; days after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; days before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addHours==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addHours(''datetime'' value, ''integer'' hours)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt; hours after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt; hours before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addMinutes==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addMinutes(''datetime'' value, ''integer'' minutes)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; minutes after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; minutes before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addSeconds==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addSeconds(''datetime'' value, ''integer'' seconds)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; seconds after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; seconds before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addWeeks==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addWeeks(''datetime'' value, ''integer'' weeks)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt; weeks after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt; weeks before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==date==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;date(''datetime'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the date portion of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; by stripping off time information.&lt;br /&gt;
&lt;br /&gt;
==datetime==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''datetime'' datetime(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Tries to convert any value into a datetime. Accepts strings in common date/time formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==formatDuration==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' formatDuration(''datetime'' value[, ''boolean'' friendly = false[, ''string'' granularity = 's'[, ''boolean'' showAdverbs = false]]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;friendly&amp;lt;/code&amp;gt; - &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; makes the output compact, in the form of &amp;lt;code&amp;gt;0d 00:00:00.000&amp;lt;/code&amp;gt;, while &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; makes the output more human friendly, in the form of &amp;lt;code&amp;gt; 0 days, 0 hours, 0 minutes, and 0 seconds&amp;lt;/code&amp;gt;. Defaults to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
::&amp;lt;code&amp;gt;granularity&amp;lt;/code&amp;gt; - represents the smallest time unit to be output. One of &amp;lt;code&amp;gt;d&amp;lt;/code&amp;gt; for days, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; for hours, &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; for minutes, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; for seconds, or &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; for milliseconds. Any time unit below the selected granularity will not be output. Defaults to &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;showAdverbs&amp;lt;/code&amp;gt; - only affects the friendly output, when &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; the words &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; (for future durations - positive input) or &amp;lt;code&amp;gt;ago&amp;lt;/code&amp;gt; (for past durations - negative input) are prepended or appended respectively to the output&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that represents the duration in a human readable format&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(12029)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;00:00:12&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, true)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;1 minute and 8 seconds&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, false, 'ms')&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;00:01:08&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, true, 'm', true)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;in 1 minute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==time==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''time'' time(''datetime'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the time portion of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; by stripping off date information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Weather related functions=&lt;br /&gt;
&lt;br /&gt;
==celsius==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' celsius(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts a temperature value from Fahrenheit to Celsius.&lt;br /&gt;
&lt;br /&gt;
==dewPoint==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' dewPoint(''decimal'' temperature, ''decimal'' relativeHumidity[, ''string'' scale = 'F'])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Parameters&lt;br /&gt;
::&amp;lt;code&amp;gt;scale&amp;lt;/code&amp;gt; - optional, one of &amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt;, corresponding to the temperature range used for &amp;lt;code&amp;gt;temperature&amp;lt;/code&amp;gt;. The result will be provided in the same scale. If no scale is provided, the Fahrenheit scale will be used.&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the due temperature for a given temperature and relative humidity&lt;br /&gt;
&lt;br /&gt;
==fahrenheit==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' fahrenheit(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts a temperature value from Celsius to Fahrenheit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Dynamic|Dynamic]] =&lt;br /&gt;
;if(condition, valueIfTrue, valueIfFalse)&lt;br /&gt;
:evaluates a boolean and returns value1 if true, or value2 otherwise&lt;br /&gt;
;least(values)&lt;br /&gt;
:returns the value that is least found a series of numeric values&lt;br /&gt;
;most(values)&lt;br /&gt;
:returns the value that is most found a series of numeric values&lt;br /&gt;
;previousValue([device;attribute])&lt;br /&gt;
:returns the previous value of the attribute&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Number_.28Integer.29|Integers]] =&lt;br /&gt;
;age([device:attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the current value&lt;br /&gt;
;count(values)&lt;br /&gt;
:calculates the number of true/non-zero/non-empty items in a series of numeric values&lt;br /&gt;
;int()&lt;br /&gt;
://todo&lt;br /&gt;
;integer(decimal or string)&lt;br /&gt;
:converts a decimal value to it's integer value&lt;br /&gt;
;newer([device:attribute],[...], [device:attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for less than the specified number of milliseconds&lt;br /&gt;
;older([device:attribute],[...], [device:attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for more than the specified number of milliseconds&lt;br /&gt;
;previousAge([device:attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the previous value&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Time|Time]] =&lt;br /&gt;
;time(value)&lt;br /&gt;
:returns the value as a time type&lt;br /&gt;
;addSeconds(dateTime, seconds)&lt;br /&gt;
:adds seconds to time, returns the value as a time type&lt;br /&gt;
;addMinutes(dateTime, minutes)&lt;br /&gt;
:adds minutes to time, returns the value as a time type&lt;br /&gt;
;addHours(dateTime, hours)&lt;br /&gt;
:adds hours to time, returns the value as a time type&lt;br /&gt;
;addDays(dateTime, days)&lt;br /&gt;
:adds days to time, returns the value as a time type&lt;br /&gt;
;addWeeks(dateTime, weeks)&lt;br /&gt;
:adds weeks to time, returns the value as a time type&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=User:Ahndee&amp;diff=325</id>
		<title>User:Ahndee</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=User:Ahndee&amp;diff=325"/>
				<updated>2017-05-06T22:20:02Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SmartThings app slinger - see https://github.com/ahndee/Envoy-ST for my custom solar monitoring DTHs for Enphase Envoy and SolarEdge.&lt;br /&gt;
&lt;br /&gt;
https://gvconnect.com&lt;br /&gt;
&lt;br /&gt;
http://andreasamann.com&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=Functions&amp;diff=324</id>
		<title>Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=Functions&amp;diff=324"/>
				<updated>2017-05-06T18:42:33Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Fix descriptions for ceil &amp;amp; floor, adding examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: right; clear: both; margin-left: 1em; margin-bottom: 1em;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
Functions are extensions to expressions that allow data processing and conversion. Here is a list of all defined functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#String|String]] functions=&lt;br /&gt;
&lt;br /&gt;
==concat==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' concat(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that is the concatenation of all the supplied values. This function accepts two or more input values.&lt;br /&gt;
&lt;br /&gt;
==contains==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' contains(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; is found anywhere in the &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==endsWith==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' endsWith(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; ends with the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==format==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' format(''string'' formatString[, ''dynamic'' value1[, .., ''dynamic'' valueN]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that is built based on the &amp;lt;code&amp;gt;formatString&amp;lt;/code&amp;gt; with arguments replaced by their corresponding values. Follows the java syntax for &amp;lt;code&amp;gt;printf()&amp;lt;/code&amp;gt;. See a quick reference [https://www.cs.colostate.edu/~cs160/.Summer16/resources/Java_printf_method_quick_reference.pdf here], or a more detailed reference [https://sharkysoft.com/archive/printf/docs/javadocs/lava/clib/stdio/doc-files/specification.htm Reference here].&lt;br /&gt;
::Each % in the format string represents an argument and corresponds to a value (in order of appearance) in the value list. Each argument can have formatting settings, according to the reference provided. &lt;br /&gt;
:Example&lt;br /&gt;
::&amp;lt;code&amp;gt;format('The temperature outside is %.2f degrees Fahrenheit', [Temp sensor:temperature])&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;The temperature outside is 71.26 degrees Fahrenheit&amp;lt;/code&amp;gt;&lt;br /&gt;
::The &amp;lt;code&amp;gt;%.2f&amp;lt;/code&amp;gt; translates to &amp;quot;format as &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt;loat and use &amp;lt;code&amp;gt;.2&amp;lt;/code&amp;gt; decimal places.&lt;br /&gt;
&lt;br /&gt;
==indexOf==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' indexOf(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the character index of the first occurrence of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;indexOf(&amp;quot;hello world&amp;quot;, 'l')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lastIndexOf==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' lastIndexOf(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the character index of the last occurrence of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lastIndexOf(&amp;quot;hello world&amp;quot;, 'l')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;9&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==left==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' left(''string'' value, ''integer'' length)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the first &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; characters in &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;left(&amp;quot;hello world&amp;quot;, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;he&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lower==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' lower(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but with all lower case letters.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello World&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hello world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==mid==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' mid(''string'' value, ''integer'' start[, ''integer'' count = remaining])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; - provides the 0-based index of the first character to copy. If &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; is negative, the counting starts from the end of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
::&amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; - provides the number of characters to copy from &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. If not provided, all of the remaining characters from &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; are returned, starting with character number &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is negative, prior characters are returned.&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a substring of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; characters long, starting at character number &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;. Note that the first character in any string has index 0.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, 2, 3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;llo&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;llo World&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, -5, 2)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Wo&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;mid(&amp;quot;Hello World&amp;quot;, -1, -3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;orl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==replace==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' replace(''string'' haystack, ''string'' needle1, ''string'' replacement1[, .., ''string'' needleN, ''string'' replacementN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Replaces all the occurrences of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt; inside &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; with its respective &amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt;. Multiple pairs of &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;replacement&amp;lt;/code&amp;gt; can be provided in one function call.&lt;br /&gt;
:Regular expressions&lt;br /&gt;
::Needles support regular expressions when their value starts and ends with a &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;. For example, &amp;lt;code&amp;gt;'/(\s)/'&amp;lt;/code&amp;gt; will match all spaces.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello Earth&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth', 'Hello', 'Hi')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hi Earth&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;replace(&amp;quot;Hello World&amp;quot;, 'World', 'Earth', 'Earth', 'Planet')&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello Planet&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==right==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' right(''string'' value, ''integer'' length)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the last &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; characters in &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;right(&amp;quot;hello world&amp;quot;, 4)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;orld&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==startsWith==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''boolean'' startsWith(''string'' haystack, ''string'' needle)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;haystack&amp;lt;/code&amp;gt; starts with the &amp;lt;code&amp;gt;needle&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==string==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' string(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; as a string.&lt;br /&gt;
&lt;br /&gt;
==substr==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;mid()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==substring==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;mid()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==title==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' title(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but in its title case format (each word starts with a capitalized letter).&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello there world&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;Hello There World&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==upper==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' upper(''string'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; but with all upper case letters.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;lower(&amp;quot;Hello World&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;HELLO WORLD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==text==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;string()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Numeric functions=&lt;br /&gt;
&lt;br /&gt;
==avg==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' avg(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the mean average of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==ceil==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' ceil(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the immediately higher integer, equivalent to rounding the decimal away from zero.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;ceil(5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;ceil(-5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;-6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ceiling==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;ceil&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==decimal==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' decimal(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; into a decimal. Returns &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is not numeric.&lt;br /&gt;
&lt;br /&gt;
==float==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;decimal&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==floor==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''integer'' ceil(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the integer part of a decimal, equivalent to rounding the decimal towards zero.&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;floor(5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;floor(-5.6)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;-5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==max==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' max(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the maximum of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==median==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' median(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the median average of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==min==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''dynamic'' min(''dynamic'' value1, ''dynamic'' value2[, .., ''dynamic'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the minimum of all the values provided. Note: this function works with both numbers and strings.&lt;br /&gt;
&lt;br /&gt;
==number==&lt;br /&gt;
:Alias of &amp;lt;code&amp;gt;decimal&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==power==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' power(''decimal'' value, ''decimal'' exponent)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; at the power of &amp;lt;code&amp;gt;exponent&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==round==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' round(''decimal'' value[, ''integer'' precision = 0])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;precision&amp;lt;/code&amp;gt; - the number of decimal places to be retained. If not provided, defaults to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the rounded &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;precision&amp;lt;/code&amp;gt; decimal places.&lt;br /&gt;
&lt;br /&gt;
==sqr==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sqr(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the squared &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, equivalent to &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; multiplied by itself.&lt;br /&gt;
&lt;br /&gt;
==sqrt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sqrt(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the square root of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==stdev==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' stdev(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the standard deviation of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==sum==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' sum(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the sum of sum of all the values provided.&lt;br /&gt;
&lt;br /&gt;
==variance==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' variance(''decimal'' value1, ''decimal'' value2[, .., ''decimal'' valueN])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the variance of all the values provided.&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#Boolean|Boolean]] functions=&lt;br /&gt;
&lt;br /&gt;
==bool==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;bool(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the truth value of the input. Accepts anything as input and will return true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is either a non-zero number, a non-empty string (with some exceptions, see below), a non-empty device list, a non-empty date/time/datetime&lt;br /&gt;
&lt;br /&gt;
==boolean==&lt;br /&gt;
:This is an alias of [[Functions#bool|bool]]&lt;br /&gt;
&lt;br /&gt;
==eq==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;eq(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ge==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;ge(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is greater than or equal to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==gt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;gt(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is greater than &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==isBetween==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;isBetween(''dynamic'' value, ''dynamic'' startValue, ''dynamic'' endValue)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is greater then or equal to &amp;lt;code&amp;gt;startValue&amp;lt;/code&amp;gt; and less than or equal to &amp;lt;code&amp;gt;endValue&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==isEmpty==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;isEmpty(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; is not set, an empty string, or zero&lt;br /&gt;
&lt;br /&gt;
==le==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;le(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is less than or equal to &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==lt==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;lt(''dynamic'' value1, ''dynamic'' value2)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns true if &amp;lt;code&amp;gt;value1&amp;lt;/code&amp;gt; is less than &amp;lt;code&amp;gt;value2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==not==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;not(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the negated truth state of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. This is the logical negation of &amp;lt;code&amp;gt;[[Functions#bool|bool]](''dynamic'' value)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=[[Variable_data_types#Date_and_Time|Date and time]] functions=&lt;br /&gt;
&lt;br /&gt;
==addDays==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addDays(''datetime'' value, ''integer'' days)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; days after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;days&amp;lt;/code&amp;gt; days before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addHours==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addHours(''datetime'' value, ''integer'' hours)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt; hours after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;hours&amp;lt;/code&amp;gt; hours before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addMinutes==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addMinutes(''datetime'' value, ''integer'' minutes)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; minutes after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;minutes&amp;lt;/code&amp;gt; minutes before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addSeconds==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addSeconds(''datetime'' value, ''integer'' seconds)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; seconds after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;seconds&amp;lt;/code&amp;gt; seconds before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==addWeeks==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;addWeeks(''datetime'' value, ''integer'' weeks)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a datetime that is &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt; weeks after the &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. For negative values of &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt;, it returns a datetime that is &amp;lt;code&amp;gt;weeks&amp;lt;/code&amp;gt; weeks before &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==date==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;date(''datetime'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the date portion of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; by stripping off time information.&lt;br /&gt;
&lt;br /&gt;
==datetime==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''datetime'' datetime(''dynamic'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Tries to convert any value into a datetime. Accepts strings in common date/time formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==formatDuration==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''string'' formatDuration(''datetime'' value[, ''boolean'' friendly = false[, ''string'' granularity = 's'[, ''boolean'' showAdverbs = false]]])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Arguments&lt;br /&gt;
::&amp;lt;code&amp;gt;friendly&amp;lt;/code&amp;gt; - &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; makes the output compact, in the form of &amp;lt;code&amp;gt;0d 00:00:00.000&amp;lt;/code&amp;gt;, while &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; makes the output more human friendly, in the form of &amp;lt;code&amp;gt; 0 days, 0 hours, 0 minutes, and 0 seconds&amp;lt;/code&amp;gt;. Defaults to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
::&amp;lt;code&amp;gt;granularity&amp;lt;/code&amp;gt; - represents the smallest time unit to be output. One of &amp;lt;code&amp;gt;d&amp;lt;/code&amp;gt; for days, &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; for hours, &amp;lt;code&amp;gt;m&amp;lt;/code&amp;gt; for minutes, &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; for seconds, or &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt; for milliseconds. Any time unit below the selected granularity will not be output. Defaults to &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;showAdverbs&amp;lt;/code&amp;gt; - only affects the friendly output, when &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; the words &amp;lt;code&amp;gt;in&amp;lt;/code&amp;gt; (for future durations - positive input) or &amp;lt;code&amp;gt;ago&amp;lt;/code&amp;gt; (for past durations - negative input) are prepended or appended respectively to the output&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns a string that represents the duration in a human readable format&lt;br /&gt;
:Examples&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(12029)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;00:00:12&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, true)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;1 minute and 8 seconds&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, false, 'ms')&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;00:01:08&amp;lt;/code&amp;gt;&lt;br /&gt;
::&amp;lt;code&amp;gt;formatDuration(68493, true, 'm', true)&amp;lt;/code&amp;gt; will output &amp;lt;code&amp;gt;in 1 minute&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==time==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''time'' time(''datetime'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the time portion of &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; by stripping off date information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Weather related functions=&lt;br /&gt;
&lt;br /&gt;
==celsius==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' celsius(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts a temperature value from Fahrenheit to Celsius.&lt;br /&gt;
&lt;br /&gt;
==dewPoint==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' dewPoint(''decimal'' temperature, ''decimal'' relativeHumidity[, ''string'' scale = 'F'])&amp;lt;/code&amp;gt;&lt;br /&gt;
:Parameters&lt;br /&gt;
::&amp;lt;code&amp;gt;scale&amp;lt;/code&amp;gt; - optional, one of &amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt;, corresponding to the temperature range used for &amp;lt;code&amp;gt;temperature&amp;lt;/code&amp;gt;. The result will be provided in the same scale. If no scale is provided, the Fahrenheit scale will be used.&lt;br /&gt;
:Returns&lt;br /&gt;
::Returns the due temperature for a given temperature and relative humidity&lt;br /&gt;
&lt;br /&gt;
==fahrenheit==&lt;br /&gt;
:Syntax&lt;br /&gt;
::&amp;lt;code&amp;gt;''decimal'' fahrenheit(''decimal'' value)&amp;lt;/code&amp;gt;&lt;br /&gt;
:Returns&lt;br /&gt;
::Converts a temperature value from Celsius to Fahrenheit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Dynamic|Dynamic]] =&lt;br /&gt;
;if(condition, valueIfTrue, valueIfFalse)&lt;br /&gt;
:evaluates a boolean and returns value1 if true, or value2 otherwise&lt;br /&gt;
;least(values)&lt;br /&gt;
:returns the value that is least found a series of numeric values&lt;br /&gt;
;most(values)&lt;br /&gt;
:returns the value that is most found a series of numeric values&lt;br /&gt;
;previousValue([device;attribute])&lt;br /&gt;
:returns the previous value of the attribute&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Number_.28Integer.29|Integers]] =&lt;br /&gt;
;age([device;attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the current value&lt;br /&gt;
;count(values)&lt;br /&gt;
:calculates the number of true/non-zero/non-empty items in a series of numeric values&lt;br /&gt;
;int()&lt;br /&gt;
://todo&lt;br /&gt;
;integer(decimal or string)&lt;br /&gt;
:converts a decimal value to it's integer value&lt;br /&gt;
;newer([device;attribute],[...], [device;attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for less than the specified number of milliseconds&lt;br /&gt;
;older([device;attribute],[...], [device;attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for more than the specified number of milliseconds&lt;br /&gt;
;previousAge([device;attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the previous value&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Time|Time]] =&lt;br /&gt;
;time(value)&lt;br /&gt;
:returns the value as a time type&lt;br /&gt;
;addSeconds(dateTime, seconds)&lt;br /&gt;
:adds seconds to time, returns the value as a time type&lt;br /&gt;
;addMinutes(dateTime, minutes)&lt;br /&gt;
:adds minutes to time, returns the value as a time type&lt;br /&gt;
;addHours(dateTime, hours)&lt;br /&gt;
:adds hours to time, returns the value as a time type&lt;br /&gt;
;addDays(dateTime, days)&lt;br /&gt;
:adds days to time, returns the value as a time type&lt;br /&gt;
;addWeeks(dateTime, weeks)&lt;br /&gt;
:adds weeks to time, returns the value as a time type&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=Functions&amp;diff=310</id>
		<title>Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=Functions&amp;diff=310"/>
				<updated>2017-05-05T22:20:10Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Correct return time for add…() Datetime functions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= [[Variable_data_types#Boolean|Boolean]] =&lt;br /&gt;
;bool()&lt;br /&gt;
://todo&lt;br /&gt;
;boolean(anything)&lt;br /&gt;
:converts a value to it's boolean value&lt;br /&gt;
;contains(string, substring)&lt;br /&gt;
:returns true if a string contains a substring&lt;br /&gt;
;endsWith(string, substring)&lt;br /&gt;
:returns true if a string ends with a substring&lt;br /&gt;
;eq(value1, value2)&lt;br /&gt;
:returns true if two values are equal&lt;br /&gt;
;ge(value1, value2)&lt;br /&gt;
:returns true if value1 &amp;gt;= value2&lt;br /&gt;
;gt(value1, value2)&lt;br /&gt;
:returns true if value1 &amp;gt; value2&lt;br /&gt;
;isBetween(value, startValue, endValue)&lt;br /&gt;
:returns true if value &amp;gt;= startValue and value &amp;lt;= endValue&lt;br /&gt;
;isEmpty(value)&lt;br /&gt;
:returns true if the value is empty&lt;br /&gt;
;le(value1, value2)&lt;br /&gt;
:returns true if value1 &amp;lt;= value2&lt;br /&gt;
;lt(value1, value2)&lt;br /&gt;
:returns true if value1 &amp;lt; value2	&lt;br /&gt;
;not(value)&lt;br /&gt;
:returns the negative boolean value&lt;br /&gt;
;startsWith(string, substring)&lt;br /&gt;
:returns true if a string starts with a substring&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Date|Date]] =&lt;br /&gt;
;date(value)&lt;br /&gt;
:returns the value as a date type&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Date_and_Time|Datetime]] =&lt;br /&gt;
;addDays(dateTime, days)&lt;br /&gt;
:returns the value as a Datetime type&lt;br /&gt;
;addHours(dateTime, hours)&lt;br /&gt;
:returns the value as a Datetime type&lt;br /&gt;
;addMinutes(dateTime, minutes)&lt;br /&gt;
:returns the value as a Datetime type&lt;br /&gt;
;addSeconds(dateTime, seconds)&lt;br /&gt;
:returns the value as a Datetime type&lt;br /&gt;
;addWeeks(dateTime, weeks)&lt;br /&gt;
:returns the value as a Datetime type&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Number_.28Decimal.29|Decimal]] =&lt;br /&gt;
;avg(values)&lt;br /&gt;
:calculates the average of a series of numeric values&lt;br /&gt;
;ceil()&lt;br /&gt;
://todo&lt;br /&gt;
;ceiling(decimal or string)&lt;br /&gt;
:converts a decimal value to it's closest higher integer value&lt;br /&gt;
;celsius(temperature) &lt;br /&gt;
:converts temperature from Fahrenheit to Celsius&lt;br /&gt;
;decimal(integer or string)&lt;br /&gt;
:converts an integer value to it's decimal value&lt;br /&gt;
;dewPoint(temperature, relativeHumidity[, scale])&lt;br /&gt;
:returns the calculated dew point temperature&lt;br /&gt;
;fahrenheit([Sensor;temperature]) &lt;br /&gt;
:converts temperature from Celsius to Fahrenheit&lt;br /&gt;
;float()&lt;br /&gt;
://todo&lt;br /&gt;
;floor(decimal or string)&lt;br /&gt;
:converts a decimal value to it's closest lower integer value&lt;br /&gt;
;max(values)&lt;br /&gt;
:calculates the maximum of a series of numeric values&lt;br /&gt;
;median(values)&lt;br /&gt;
:returns the value in the middle of a sorted array&lt;br /&gt;
;min(values)&lt;br /&gt;
:calculates the minimum of a series of numeric values&lt;br /&gt;
;number()&lt;br /&gt;
://todo&lt;br /&gt;
;power(integer or decimal or string, power) &lt;br /&gt;
:converts a decimal value to it's power decimal value&lt;br /&gt;
;round(decimal or string, [precision]) &lt;br /&gt;
:converts a decimal value to it's rounded value&lt;br /&gt;
;sqr(integer or decimal or string) &lt;br /&gt;
:converts a decimal value to it's square decimal value&lt;br /&gt;
;sqrt(integer or decimal or string) &lt;br /&gt;
:converts a decimal value to it's square root decimal value&lt;br /&gt;
;stdev(values)&lt;br /&gt;
:calculates the standard deviation of a series of numeric values&lt;br /&gt;
;sum(values)&lt;br /&gt;
:calculates the sum of a series of numeric values&lt;br /&gt;
;variance(values)&lt;br /&gt;
:calculates the standard deviation of a series of numeric values&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Dynamic|Dynamic]] =&lt;br /&gt;
;if(condition, valueIfTrue, valueIfFalse)&lt;br /&gt;
:evaluates a boolean and returns value1 if true, or value2 otherwise&lt;br /&gt;
;least(values)&lt;br /&gt;
:returns the value that is least found a series of numeric values&lt;br /&gt;
;most(values)&lt;br /&gt;
:returns the value that is most found a series of numeric values&lt;br /&gt;
;previousValue([device;attribute])&lt;br /&gt;
:returns the previous value of the attribute&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Number_.28Integer.29|Integers]] =&lt;br /&gt;
;age([device;attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the current value&lt;br /&gt;
;count(values)&lt;br /&gt;
:calculates the number of true/non-zero/non-empty items in a series of numeric values&lt;br /&gt;
;int()&lt;br /&gt;
://todo&lt;br /&gt;
;integer(decimal or string)&lt;br /&gt;
:converts a decimal value to it's integer value&lt;br /&gt;
;newer([device;attribute],[...], [device;attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for less than the specified number of milliseconds&lt;br /&gt;
;older([device;attribute],[...], [device;attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for more than the specified number of milliseconds&lt;br /&gt;
;previousAge([device;attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the previous value&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#String|String]] =&lt;br /&gt;
;concat(string1, string2) &lt;br /&gt;
:returns two strings appended together&lt;br /&gt;
: Example: &amp;lt;code&amp;gt;concat(&amp;quot;hello &amp;quot;, &amp;quot;world&amp;quot;)&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;concat(&amp;quot;hello&amp;quot;, &amp;quot; &amp;quot;, &amp;quot;world&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hello world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;format(format string, values) &lt;br /&gt;
:Usage:&lt;br /&gt;
::formatString is a Java printf() type format string (see [https://sharkysoft.com/archive/printf/docs/javadocs/lava/clib/stdio/doc-files/specification.htm Reference])&lt;br /&gt;
::values is a dynamic length list of values (one entry for each % in the format string)&lt;br /&gt;
:returns a string with the placeholders replaced with the appropriately formatted values&lt;br /&gt;
: Example: &amp;lt;code&amp;gt;format('The temperature outside is %.2f degrees Fahrenheit', [Temp sensor:temperature])&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;The temperature outside is 71.26 degrees Fahrenheit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;formatDuration(value[, friendly = false[, granularity = 's'[, showAdverbs = false]]])&lt;br /&gt;
:Usage:&lt;br /&gt;
::value is a number of milliseconds&lt;br /&gt;
::friendly = true/false (false &amp;gt;&amp;gt;&amp;gt; 0d 00:00:00.000, true &amp;gt;&amp;gt;&amp;gt; so many days, so many hours, etc)&lt;br /&gt;
::granularity = one of ms, s, m, h, d (smallest part displayed)&lt;br /&gt;
::showAdverbs = true/false, true adds the in .... or .... ago to friendly times&lt;br /&gt;
:returns a nicely formatted string of time &lt;br /&gt;
:eg: formatDuration(12029) - 00:00:12 | formatDuration(12029, true) - 12 seconds | formatDuration(12029, true, &amp;quot;m&amp;quot;) - 0 minutes | formatDuration(12029, true, &amp;quot;ms&amp;quot;, true) - in 12 seconds and 29 milliseconds&lt;br /&gt;
&lt;br /&gt;
;left(string, count) &lt;br /&gt;
:returns a substring of a value&lt;br /&gt;
:Example1: &amp;lt;code&amp;gt;left(&amp;quot;hello world&amp;quot;, 3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hel&amp;lt;/code&amp;gt;&lt;br /&gt;
:Example2: &amp;lt;code&amp;gt;left(&amp;quot;hello world&amp;quot;, 7)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hello w&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;lower(string)&lt;br /&gt;
:returns a lower case value of a string&lt;br /&gt;
:Example: &amp;lt;code&amp;gt;lower(&amp;quot;HELLO WORLD&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hello world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;mid(string, start, count)&lt;br /&gt;
:returns a substring of a value&lt;br /&gt;
:returns characters (including spaces) specified by count after start position from string&lt;br /&gt;
:Example1: &amp;lt;code&amp;gt;mid(&amp;quot;hello world&amp;quot;, 3, 4)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;lo w&amp;lt;/code&amp;gt;&lt;br /&gt;
:Example2: &amp;lt;code&amp;gt;mid(&amp;quot;hello world&amp;quot;, 6, 3)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;wor&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;replace(string, search, replace[, [..], search, replace])&lt;br /&gt;
:replaces a search text inside of a value&lt;br /&gt;
:Example1: &amp;lt;code&amp;gt;replace(&amp;quot;hello world&amp;quot;, &amp;quot;world&amp;quot;, &amp;quot;earth&amp;quot;)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;hello earth&amp;lt;/code&amp;gt;&lt;br /&gt;
:Example2: &amp;lt;code&amp;gt;replace(replace(&amp;quot;[hello world]&amp;quot;, &amp;quot;\[&amp;quot;, &amp;quot;(&amp;quot;),&amp;quot;\]&amp;quot;,&amp;quot;)&amp;quot;)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;(hello world)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Note: There are special characters in regular expressions that needs to be escaped or the script will return an error, in the above example [ and ] are special characters.&lt;br /&gt;
&lt;br /&gt;
;right(string, count)&lt;br /&gt;
:returns a substring of a value&lt;br /&gt;
;sprintf(format, arguments)&lt;br /&gt;
:formats a series of values into a string&lt;br /&gt;
;string(anything)&lt;br /&gt;
:converts a value to it's string value&lt;br /&gt;
;substring(string, start, count)&lt;br /&gt;
:returns a substring of a value&lt;br /&gt;
;text()&lt;br /&gt;
://todo&lt;br /&gt;
;title(string)&lt;br /&gt;
:returns a title case value of a string&lt;br /&gt;
;upper(string)&lt;br /&gt;
:returns an upper case value of a string&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Time|Time]] =&lt;br /&gt;
;time(value)&lt;br /&gt;
:returns the value as a time type&lt;br /&gt;
;addSeconds(dateTime, seconds)&lt;br /&gt;
:adds seconds to time, returns the value as a time type&lt;br /&gt;
;addMinutes(dateTime, minutes)&lt;br /&gt;
:adds minutes to time, returns the value as a time type&lt;br /&gt;
;addHours(dateTime, hours)&lt;br /&gt;
:adds hours to time, returns the value as a time type&lt;br /&gt;
;addDays(dateTime, days)&lt;br /&gt;
:adds days to time, returns the value as a time type&lt;br /&gt;
;addWeeks(dateTime, weeks)&lt;br /&gt;
:adds weeks to time, returns the value as a time type&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	<entry>
		<id>https://wiki.webcore.co/index.php?title=Functions&amp;diff=309</id>
		<title>Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.webcore.co/index.php?title=Functions&amp;diff=309"/>
				<updated>2017-05-05T22:08:59Z</updated>
		
		<summary type="html">&lt;p&gt;Ahndee: Add description for format()&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= [[Variable_data_types#Boolean|Boolean]] =&lt;br /&gt;
;bool()&lt;br /&gt;
://todo&lt;br /&gt;
;boolean(anything)&lt;br /&gt;
:converts a value to it's boolean value&lt;br /&gt;
;contains(string, substring)&lt;br /&gt;
:returns true if a string contains a substring&lt;br /&gt;
;endsWith(string, substring)&lt;br /&gt;
:returns true if a string ends with a substring&lt;br /&gt;
;eq(value1, value2)&lt;br /&gt;
:returns true if two values are equal&lt;br /&gt;
;ge(value1, value2)&lt;br /&gt;
:returns true if value1 &amp;gt;= value2&lt;br /&gt;
;gt(value1, value2)&lt;br /&gt;
:returns true if value1 &amp;gt; value2&lt;br /&gt;
;isBetween(value, startValue, endValue)&lt;br /&gt;
:returns true if value &amp;gt;= startValue and value &amp;lt;= endValue&lt;br /&gt;
;isEmpty(value)&lt;br /&gt;
:returns true if the value is empty&lt;br /&gt;
;le(value1, value2)&lt;br /&gt;
:returns true if value1 &amp;lt;= value2&lt;br /&gt;
;lt(value1, value2)&lt;br /&gt;
:returns true if value1 &amp;lt; value2	&lt;br /&gt;
;not(value)&lt;br /&gt;
:returns the negative boolean value&lt;br /&gt;
;startsWith(string, substring)&lt;br /&gt;
:returns true if a string starts with a substring&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Date|Date]] =&lt;br /&gt;
;date(value)&lt;br /&gt;
:returns the value as a date type&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Date_and_Time|Datetime]] =&lt;br /&gt;
;addDays(dateTime, days)&lt;br /&gt;
:returns the value as a time type&lt;br /&gt;
;addHours(dateTime, hours)&lt;br /&gt;
:returns the value as a time type&lt;br /&gt;
;addMinutes(dateTime, minutes)&lt;br /&gt;
:returns the value as a time type&lt;br /&gt;
;addSeconds(dateTime, seconds)&lt;br /&gt;
:returns the value as a time type&lt;br /&gt;
;addWeeks(dateTime, weeks)&lt;br /&gt;
:returns the value as a time type&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Number_.28Decimal.29|Decimal]] =&lt;br /&gt;
;avg(values)&lt;br /&gt;
:calculates the average of a series of numeric values&lt;br /&gt;
;ceil()&lt;br /&gt;
://todo&lt;br /&gt;
;ceiling(decimal or string)&lt;br /&gt;
:converts a decimal value to it's closest higher integer value&lt;br /&gt;
;celsius(temperature) &lt;br /&gt;
:converts temperature from Fahrenheit to Celsius&lt;br /&gt;
;decimal(integer or string)&lt;br /&gt;
:converts an integer value to it's decimal value&lt;br /&gt;
;dewPoint(temperature, relativeHumidity[, scale])&lt;br /&gt;
:returns the calculated dew point temperature&lt;br /&gt;
;fahrenheit([Sensor;temperature]) &lt;br /&gt;
:converts temperature from Celsius to Fahrenheit&lt;br /&gt;
;float()&lt;br /&gt;
://todo&lt;br /&gt;
;floor(decimal or string)&lt;br /&gt;
:converts a decimal value to it's closest lower integer value&lt;br /&gt;
;max(values)&lt;br /&gt;
:calculates the maximum of a series of numeric values&lt;br /&gt;
;median(values)&lt;br /&gt;
:returns the value in the middle of a sorted array&lt;br /&gt;
;min(values)&lt;br /&gt;
:calculates the minimum of a series of numeric values&lt;br /&gt;
;number()&lt;br /&gt;
://todo&lt;br /&gt;
;power(integer or decimal or string, power) &lt;br /&gt;
:converts a decimal value to it's power decimal value&lt;br /&gt;
;round(decimal or string, [precision]) &lt;br /&gt;
:converts a decimal value to it's rounded value&lt;br /&gt;
;sqr(integer or decimal or string) &lt;br /&gt;
:converts a decimal value to it's square decimal value&lt;br /&gt;
;sqrt(integer or decimal or string) &lt;br /&gt;
:converts a decimal value to it's square root decimal value&lt;br /&gt;
;stdev(values)&lt;br /&gt;
:calculates the standard deviation of a series of numeric values&lt;br /&gt;
;sum(values)&lt;br /&gt;
:calculates the sum of a series of numeric values&lt;br /&gt;
;variance(values)&lt;br /&gt;
:calculates the standard deviation of a series of numeric values&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Dynamic|Dynamic]] =&lt;br /&gt;
;if(condition, valueIfTrue, valueIfFalse)&lt;br /&gt;
:evaluates a boolean and returns value1 if true, or value2 otherwise&lt;br /&gt;
;least(values)&lt;br /&gt;
:returns the value that is least found a series of numeric values&lt;br /&gt;
;most(values)&lt;br /&gt;
:returns the value that is most found a series of numeric values&lt;br /&gt;
;previousValue([device;attribute])&lt;br /&gt;
:returns the previous value of the attribute&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Number_.28Integer.29|Integers]] =&lt;br /&gt;
;age([device;attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the current value&lt;br /&gt;
;count(values)&lt;br /&gt;
:calculates the number of true/non-zero/non-empty items in a series of numeric values&lt;br /&gt;
;int()&lt;br /&gt;
://todo&lt;br /&gt;
;integer(decimal or string)&lt;br /&gt;
:converts a decimal value to it's integer value&lt;br /&gt;
;newer([device;attribute],[...], [device;attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for less than the specified number of milliseconds&lt;br /&gt;
;older([device;attribute],[...], [device;attribute], threshold)&lt;br /&gt;
:returns the number of devices whose attribute had the current value for more than the specified number of milliseconds&lt;br /&gt;
;previousAge([device;attribute])&lt;br /&gt;
:returns the number of milliseconds an attribute had the previous value&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#String|String]] =&lt;br /&gt;
;concat(string1, string2) &lt;br /&gt;
:returns two strings appended together&lt;br /&gt;
: Example: &amp;lt;code&amp;gt;concat(&amp;quot;hello &amp;quot;, &amp;quot;world&amp;quot;)&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;concat(&amp;quot;hello&amp;quot;, &amp;quot; &amp;quot;, &amp;quot;world&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hello world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;format(format string, values) &lt;br /&gt;
:Usage:&lt;br /&gt;
::formatString is a Java printf() type format string (see [https://sharkysoft.com/archive/printf/docs/javadocs/lava/clib/stdio/doc-files/specification.htm Reference])&lt;br /&gt;
::values is a dynamic length list of values (one entry for each % in the format string)&lt;br /&gt;
:returns a string with the placeholders replaced with the appropriately formatted values&lt;br /&gt;
: Example: &amp;lt;code&amp;gt;format('The temperature outside is %.2f degrees Fahrenheit', [Temp sensor:temperature])&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;The temperature outside is 71.26 degrees Fahrenheit&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;formatDuration(value[, friendly = false[, granularity = 's'[, showAdverbs = false]]])&lt;br /&gt;
:Usage:&lt;br /&gt;
::value is a number of milliseconds&lt;br /&gt;
::friendly = true/false (false &amp;gt;&amp;gt;&amp;gt; 0d 00:00:00.000, true &amp;gt;&amp;gt;&amp;gt; so many days, so many hours, etc)&lt;br /&gt;
::granularity = one of ms, s, m, h, d (smallest part displayed)&lt;br /&gt;
::showAdverbs = true/false, true adds the in .... or .... ago to friendly times&lt;br /&gt;
:returns a nicely formatted string of time &lt;br /&gt;
:eg: formatDuration(12029) - 00:00:12 | formatDuration(12029, true) - 12 seconds | formatDuration(12029, true, &amp;quot;m&amp;quot;) - 0 minutes | formatDuration(12029, true, &amp;quot;ms&amp;quot;, true) - in 12 seconds and 29 milliseconds&lt;br /&gt;
&lt;br /&gt;
;left(string, count) &lt;br /&gt;
:returns a substring of a value&lt;br /&gt;
:Example1: &amp;lt;code&amp;gt;left(&amp;quot;hello world&amp;quot;, 3)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hel&amp;lt;/code&amp;gt;&lt;br /&gt;
:Example2: &amp;lt;code&amp;gt;left(&amp;quot;hello world&amp;quot;, 7)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hello w&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;lower(string)&lt;br /&gt;
:returns a lower case value of a string&lt;br /&gt;
:Example: &amp;lt;code&amp;gt;lower(&amp;quot;HELLO WORLD&amp;quot;)&amp;lt;/code&amp;gt; outputs &amp;lt;code&amp;gt;hello world&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;mid(string, start, count)&lt;br /&gt;
:returns a substring of a value&lt;br /&gt;
:returns characters (including spaces) specified by count after start position from string&lt;br /&gt;
:Example1: &amp;lt;code&amp;gt;mid(&amp;quot;hello world&amp;quot;, 3, 4)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;lo w&amp;lt;/code&amp;gt;&lt;br /&gt;
:Example2: &amp;lt;code&amp;gt;mid(&amp;quot;hello world&amp;quot;, 6, 3)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;wor&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;replace(string, search, replace[, [..], search, replace])&lt;br /&gt;
:replaces a search text inside of a value&lt;br /&gt;
:Example1: &amp;lt;code&amp;gt;replace(&amp;quot;hello world&amp;quot;, &amp;quot;world&amp;quot;, &amp;quot;earth&amp;quot;)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;hello earth&amp;lt;/code&amp;gt;&lt;br /&gt;
:Example2: &amp;lt;code&amp;gt;replace(replace(&amp;quot;[hello world]&amp;quot;, &amp;quot;\[&amp;quot;, &amp;quot;(&amp;quot;),&amp;quot;\]&amp;quot;,&amp;quot;)&amp;quot;)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;(hello world)&amp;lt;/code&amp;gt;&lt;br /&gt;
: Note: There are special characters in regular expressions that needs to be escaped or the script will return an error, in the above example [ and ] are special characters.&lt;br /&gt;
&lt;br /&gt;
;right(string, count)&lt;br /&gt;
:returns a substring of a value&lt;br /&gt;
;sprintf(format, arguments)&lt;br /&gt;
:formats a series of values into a string&lt;br /&gt;
;string(anything)&lt;br /&gt;
:converts a value to it's string value&lt;br /&gt;
;substring(string, start, count)&lt;br /&gt;
:returns a substring of a value&lt;br /&gt;
;text()&lt;br /&gt;
://todo&lt;br /&gt;
;title(string)&lt;br /&gt;
:returns a title case value of a string&lt;br /&gt;
;upper(string)&lt;br /&gt;
:returns an upper case value of a string&lt;br /&gt;
&lt;br /&gt;
= [[Variable_data_types#Time|Time]] =&lt;br /&gt;
;time(value)&lt;br /&gt;
:returns the value as a time type&lt;br /&gt;
;addSeconds(dateTime, seconds)&lt;br /&gt;
:adds seconds to time, returns the value as a time type&lt;br /&gt;
;addMinutes(dateTime, minutes)&lt;br /&gt;
:adds minutes to time, returns the value as a time type&lt;br /&gt;
;addHours(dateTime, hours)&lt;br /&gt;
:adds hours to time, returns the value as a time type&lt;br /&gt;
;addDays(dateTime, days)&lt;br /&gt;
:adds days to time, returns the value as a time type&lt;br /&gt;
;addWeeks(dateTime, weeks)&lt;br /&gt;
:adds weeks to time, returns the value as a time type&lt;/div&gt;</summary>
		<author><name>Ahndee</name></author>	</entry>

	</feed>