Wyjec 1.0 - standard functions
(c) Copyright by Zbigniew Chyla 2005

% ( divident : integer, divisor : integer ) : integer
Returns the remainder from division of the first parameter by the second one (modulo operation) or 0 if divisor (second parameter) equals 0.
dividentintegerValue to divide by divisordivisorintegerValue that divident is to be divided by
For example:
"{%|{7}|{2}}" returns "1" (type: integer)

% ( divident : integer, divisor : integer, defaultResult : integer ) : integer
Returns the remainder from division of the first parameter by the second one (modulo operation) or value of third parameter if divisor (second parameter) equals 0.
dividentintegerValue to divide by divisordivisorintegerValue that divident is to be divided bydefaultResultintegerValue to use as result in case divisor equals 0
For example:
"{%|{7}|{0}|{5}}" returns "5" (type: integer)

* ( value : float, optValues : float... ) : float
Returns product of all numbers given as parameters. If any parameter is NaN, the result is also NaN.
valuefloatFirst number (it will be copied to result in case its the only parameter)(optValues)float...Other optional numbers to multiply by the first one
For example:
"{*|{7.0}|{3.0}|{2.5}}" returns "52.5" (type: float)
"{*|{7.0}|{/|{0.0}|{0.0}}|{2.5}}" returns "NaN" (type: float)

* ( value : integer, optValues : integer... ) : integer
Returns product of all numbers given as parameters.
valueintegerFirst number (it will be copied to result in case its the only parameter)(optValues)integer...Other optional numbers to multiply by the first one
For example:
"{*|{7}|{3}|{2}}" returns "42" (type: integer)

+ ( value : float, optValues : float... ) : float
Returns arithmetic sum of all numbers given as parameters. If any parameter is NaN, the result is also NaN.
valuefloatFirst number (it will be copied to result in case its the only parameter)(optValues)float...Other optional numbers to add to the first one
For example:
"{+|{7.5}|{3.0}|{2.5}}" returns "13.0" (type: float)
"{+|{7.5}|{/|{0.0}|{0.0}}|{2.5}}" returns "NaN" (type: float)

+ ( value : string, optValues : string... ) : string
Returns concatenation of all strings given as parameters.
valuestringFirst string to place at the begining of the result(optValues)string...Optional strings to place after the first one
For example:
"{+|Jan| |Kowalski}" returns "Jan Kowalski" (type: string)

+ ( value : integer, optValues : integer... ) : integer
Returns arithmetic sum of all numbers given as parameters.
valueintegerFirst number (it will be copied to result in case its the only parameter)(optValues)integer...Other optional numbers to add to the first one
For example:
"{+|{7}|{3}|{2}}" returns "12" (type: integer)

+days ( baseDate : date, shiftDays : integer ) : date
Returns date value calculated by adding specified number of days to given base date.
baseDatedateBase date to use for calculationshiftDaysintegerNumber of days to add to base date
For example:
"{+days|{@1978-09-11}|{25}}" returns "1978-10-06 00:00:00" (type: date)

+hours ( baseDate : date, shiftHours : integer ) : date
Returns date value calculated by adding specified number of hours to given base date.
baseDatedateBase date to use for calculationshiftHoursintegerNumber of hours to add to base date
For example:
"{+hours|{@1978-09-11}|{31}}" returns "1978-09-12 07:00:00" (type: date)

+minutes ( baseDate : date, shiftMinutes : integer ) : date
Returns date value calculated by adding specified number of minutes to given base date.
baseDatedateBase date to use for calculationshiftMinutesintegerNumber of minutes to add to base date
For example:
"{+minutes|{@1978-09-11}|{63}}" returns "1978-09-11 01:03:00" (type: date)

+seconds ( baseDate : date, shiftSeconds : integer ) : date
Returns date value calculated by adding specified number of seconds to given base date.
baseDatedateBase date to use for calculationshiftSecondsintegerNumber of seconds to add to base date
For example:
"{+seconds|{@1977-03-09}|{70}}" returns "1977-03-09 00:01:10" (type: date)

- ( minuend : float, subtrahend : float ) : float
Returns arithmetic subtraction of two parameters. If any parameter is NaN, the result is also NaN.
minuendfloatThe number from which the subtrahend is to be subtractedsubtrahendfloatThe number to be subtracted from the minuend
For example:
"{-|{7.5}|{3.0}}" returns "4.5" (type: float)
"{-|{7.5}|{/|{0.0}|{0.0}}}" returns "NaN" (type: float)

- ( value : float ) : float
Returns arithmetic negation of given single parameter. If the parameter is NaN, the result is also NaN.
valuefloatValue to negate
For example:
"{-|{7.0}}" returns "-7.0" (type: float)
"{-|{/|{0.0}|{0.0}}}" returns "NaN" (type: float)

- ( minuend : integer, subtrahend : integer ) : integer
Returns arithmetic subtraction of two parameters.
minuendintegerThe number from which the subtrahend is to be subtractedsubtrahendintegerThe number to be subtracted from the minuend
For example:
"{-|{7}|{3}}" returns "4" (type: integer)

- ( value : integer ) : integer
Returns arithmetic negation of given single parameter with one important exception: due to the nature of two's complement representation, for minimum integer value (-9223372036854775808) this function will return value given as parameter instead of its negation.
valueintegerValue to negate
For example:
"{-|{7}}" returns "-7" (type: integer)

-days ( date1 : date, date2 : date ) : integer
Returns difference between two dates represented by number of days (it's rounded towards 0 to integral number of days). First date is subtracted from second one.
date1dateFirst date to calculate difference for (minuend)date2dateSecond date to calculate difference for (subtrahend)
For example:
"{-days|{@1978-09-11}|{@1977-03-09}}" returns "551" (type: integer)

-hours ( date1 : date, date2 : date ) : integer
Returns difference between two dates represented by number of hours (it's rounded towards 0 to integral number of hours). First date is subtracted from second one.
date1dateFirst date to calculate difference for (minuend)date2dateSecond date to calculate difference for (subtrahend)
For example:
"{-hours|{@1978-09-11}|{@1977-03-09}}" returns "13224" (type: integer)

-minutes ( date1 : date, date2 : date ) : integer
Returns difference between two dates represented by number of minutes (it's rounded towards 0 to integral number of minutes). First date is subtracted from second one.
date1dateFirst date to calculate difference for (minuend)date2dateSecond date to calculate difference for (subtrahend)
For example:
"{-minutes|{@1978-09-11}|{@1977-03-09}}" returns "793440" (type: integer)

-seconds ( date1 : date, date2 : date ) : integer
Returns difference between two dates represented by number of seconds (it's rounded towards 0 to integral number of seconds). First date is subtracted from second one.
date1dateFirst date to calculate difference for (minuend)date2dateSecond date to calculate difference for (subtrahend)
For example:
"{-seconds|{@1978-09-11}|{@1977-03-09}}" returns "47606400" (type: integer)

/ ( divident : float, divisor : float ) : float
Returns quotient of two numbers given as parameters. If any parameter is NaN, the result is also NaN.
dividentfloatValue to divide by divisordivisorfloatValue that divident is to be divided by
For example:
"{/|{7.0}|{2.0}}" returns "3.5" (type: float)
"{/|{/|{0.0}|{0.0}}|{2.0}}" returns "NaN" (type: float)

/ ( divident : integer, divisor : integer, defaultResult : integer ) : integer
Returns quotient of two numbers given as parameters or value of third parameter if divisor (second parameter) equals 0.
dividentintegerValue to divide by divisordivisorintegerValue that divident is to be divided bydefaultResultintegerValue to use as result in case divisor equals 0
For example:
"{/|{7}|{0}|{5}}" returns "5" (type: integer)

/ ( divident : integer, divisor : integer ) : integer
Returns quotient of two numbers given as parameters or 0 if divisor (second parameter) equals 0.
dividentintegerValue to divide by divisordivisorintegerValue that divident is to be divided by
For example:
"{/|{7}|{2}}" returns "3" (type: integer)

< ( value : float, optValues : float... ) : boolean
Returns boolean true if every function's parameter after the first one is less than its predecessor and boolean false otherwise. If any parameter is NaN, the result is false, otherwise if only one parameter is given, the function always returns true.
valuefloatFirst number used in comparision(optValues)float...Other optional numbers used in comparision
For example:
"{<|{2.5}|{4.0}|{7.0}}" returns "true" (type: boolean)
"{<|{/|{0.0}|{0.0}}}" returns "false" (type: boolean)

< ( value : string, optValues : string... ) : boolean
Returns boolean true if every function's parameter after the first one is less than its predecessor (strings are compared lexicographically) and boolean false otherwise. If only one parameter is given, function always returns true.
valuestringFirst value used in comparision(optValues)string...Other optional values used in comparision
For example:
"{<|Janek|Jan}" returns "false" (type: boolean)

< ( value : integer, optValues : integer... ) : boolean
Returns boolean true if every function's parameter after the first one is less than its predecessor and boolean false otherwise. If only one parameter is given, function always returns true.
valueintegerFirst number used in comparision(optValues)integer...Other optional numbers used in comparision
For example:
"{<|{2}|{4}|{7}}" returns "true" (type: boolean)

< ( date : date, optDates : date... ) : boolean
Returns boolean true if every function's parameter after the first one is less than its predecessor and boolean false otherwise. If only one parameter is given, function always returns true. "less" means here that date represented by a value is before the other one.
datedateFirst date used in comparision(optDates)date...Other optional dates used in comparision
For example:
"{<|{@1977-03-09}|{@1977-03-09}}" returns "false" (type: boolean)

<= ( value : float, optValues : float... ) : boolean
Returns boolean true if every function's parameter after the first one is less or equal to its predecessor and boolean false otherwise. If any parameter is NaN, the result is false, otherwise if only one parameter is given, function always returns true.
valuefloatFirst number used in comparision(optValues)float...Other optional numbers used in comparision
For example:
"{<=|{2.5}|{4.0}|{7.5}|{7.0}}" returns "false" (type: boolean)
"{<=|{/|{0.0}|{0.0}}|{/|{0.0}|{0.0}}}" returns "false" (type: boolean)

<= ( value : string, optValues : string... ) : boolean
Returns boolean true if every function's parameter after the first one is less or equal to its predecessor (strings are compared lexicographically) and boolean false otherwise. If only one parameter is given, function always returns true.
valuestringFirst value used in comparision(optValues)string...Other optional values used in comparision
For example:
"{<=|Adam|Jan|Kowalski|Jan}" returns "false" (type: boolean)

<= ( value : integer, optValues : integer... ) : boolean
Returns boolean true if every function's parameter after the first one is less or equal to its predecessor and boolean false otherwise. If only one parameter is given, function always returns true.
valueintegerFirst number used in comparision(optValues)integer...Other optional numbers used in comparision
For example:
"{<=|{2}|{4}|{7}|{4}}" returns "false" (type: boolean)

<= ( date : date, optDates : date... ) : boolean
Returns boolean true if every function's parameter after the first one is less or equal to its predecessor and boolean false otherwise. If only one parameter is given, function always returns true. "less" means here that date represented by a value is before the other one.
datedateFirst date used in comparision(optDates)date...Other optional dates used in comparision
For example:
"{<=|{@1975-04-09}|{@1977-03-09}|{@1975-04-09}}" returns "false" (type: boolean)

= ( value : float, optValues : float... ) : boolean
Returns boolean true if all numbers given as parameters have the same value and boolean false otherwise. Please note that equality of floating point numbers is rather tricky so this function should be avoided. If any parameter is NaN, the result is false, otherwise if only one parameter is given, function always returns true.
valuefloatFirst number used in comparision(optValues)float...Other optional numbers to compare to the first one
For example:
"{=|{7.0}|{2.0}|{7.0}}" returns "false" (type: boolean)
"{=|{/|{0.0}|{0.0}}|{/|{0.0}|{0.0}}}" returns "false" (type: boolean)

= ( value : string, optValues : string... ) : boolean
Returns boolean true if all parameters have the same value (have equal length and consist of the same sequence of characters) and boolean false otherwise.
valuestringFirst value used in comparision(optValues)string...Other optional values to compare to the first one
For example:
"{=|33|{str|{33}}}" returns "true" (type: boolean)

= ( value : integer, optValues : integer... ) : boolean
Returns boolean true if all numbers given as parameters have the same value and boolean false otherwise.
valueintegerFirst number used in comparision(optValues)integer...Other optional numbers to compare to the first one
For example:
"{=|{3}|{+|{2}|{1}}|{3}}" returns "true" (type: boolean)

= ( date : date, optDates : date... ) : boolean
Returns boolean true if all dates given as parameters have the same value and boolean false otherwise.
datedateFirst date used in comparision(optDates)date...Other optional dates to compare to the first one
For example:
"{=|{@1977-03-09 00:00:00}|{@1977-03-09}}" returns "true" (type: boolean)

= ( value : boolean, optValues : boolean... ) : boolean
Returns boolean true if all parameters have the same value (true or false) and boolean false otherwise.
valuebooleanFirst value used in comparision(optValues)boolean...Other optional values to compare to the first one
For example:
"{=|{false}|{false}|{false}}" returns "true" (type: boolean)

> ( value : float, optValues : float... ) : boolean
Returns boolean true if every function's parameter after the first one is greater than its predecessor and boolean false otherwise. If any parameter is NaN, the result is false, otherwise if only one parameter is given, the function always returns true.
valuefloatFirst number used in comparision(optValues)float...Other optional numbers used in comparision
For example:
"{>|{5.5}|{4.0}|{4.0}|{2.5}}" returns "false" (type: boolean)
"{>|{/|{0.0}|{0.0}}}" returns "false" (type: boolean)

> ( value : string, optValues : string... ) : boolean
Returns boolean true if every function's parameter after the first one is greater than its predecessor (strings are compared lexicographically) and boolean false otherwise. If only one parameter is given, function always returns true.
valuestringFirst value used in comparision(optValues)string...Other optional values used in comparision
For example:
"{>|Janek|Jan}" returns "true" (type: boolean)

> ( value : integer, optValues : integer... ) : boolean
Returns boolean true if every function's parameter after the first one is greater than its predecessor and boolean false otherwise. If only one parameter is given, function always returns true.
valueintegerFirst number used in comparision(optValues)integer...Other optional numbers used in comparision
For example:
"{>|{7}|{4}|{4}|{2}}" returns "false" (type: boolean)

> ( date : date, optDates : date... ) : boolean
Returns boolean true if every function's parameter after the first one is greater than its predecessor and boolean false otherwise. If only one parameter is given, function always returns true. "greater" means here that date represented by a value is after the other one.
datedateFirst date used in comparision(optDates)date...Other optional dates used in comparision
For example:
"{>|{@1977-03-09}|{@1978-09-11}}" returns "false" (type: boolean)

>= ( value : float, optValues : float... ) : boolean
Returns boolean true if every function's parameter after the first one is greater or equal to its predecessor and boolean false otherwise. If any parameter is NaN, the result is false, otherwise if only one parameter is given, function always returns true.
valuefloatFirst number used in comparision(optValues)float...Other optional numbers used in comparision
For example:
"{>=|{5.5}|{4.0}|{4.0}|{2.5}}" returns "true" (type: boolean)
"{>=|{/|{0.0}|{0.0}}|{/|{0.0}|{0.0}}}" returns "false" (type: boolean)

>= ( value : string, optValues : string... ) : boolean
Returns boolean true if every function's parameter after the first one is greater or equal to its predecessor (strings are compared lexicographically) and boolean false otherwise. If only one parameter is given, function always returns true.
valuestringFirst value used in comparision(optValues)string...Other optional values used in comparision
For example:
"{>=|Kowalski|Jan|Jan|Adam}" returns "true" (type: boolean)

>= ( value : integer, optValues : integer... ) : boolean
Returns boolean true if every function's parameter after the first one is greater or equal to its predecessor and boolean false otherwise. If only one parameter is given, function always returns true.
valueintegerFirst number used in comparision(optValues)integer...Other optional numbers used in comparision
For example:
"{>=|{7}|{4}|{4}|{2}}" returns "true" (type: boolean)

>= ( date : date, optDates : date... ) : boolean
Returns boolean true if every function's parameter after the first one is greater or equal to its predecessor and boolean false otherwise. If only one parameter is given, function always returns true. "greater" means here that date represented by a value is after the other one.

datedateFirst date used in comparision(optDates)date...Other optional dates used in comparision
For example:
"{>=|{@1978-09-11}|{@1977-03-09}|{@1975-04-09}}" returns "true" (type: boolean)

abs ( value : float ) : float
Returns absolute value of number given as a parameter. For infinity with any sign the function returns positive infinity. For NaN parameter the result is also NaN.
valuefloatNumber to calculate absolute value for
For example:
"{abs|{-|{7.0}}}" returns "7.0" (type: float)
"{abs|{/|{0.0}|{0.0}}}" returns "NaN" (type: float)

abs ( value : integer ) : integer
Returns absolute value of number given as a parameter with one important exception: due to the nature of two's complement representation, for minimum integer value (-9223372036854775808) this function will return value given as parameter, even if it's negative.
valueintegerNumber to calculate absolute value for
For example:
"{abs|{-7}}" returns "7" (type: integer)

and ( value : boolean, optValues : boolean... ) : boolean
Returns boolean true if all parameters have value true and boolean false otherwise (logical conjunction).
valuebooleanFirst value to use (it will be copied to result in case its the only parameter)(optValues)boolean...Other optional values to use
For example:
"{and|{true}|{false}|{true}}" returns "false" (type: boolean)

ceil ( value : float ) : float
Rounds given number up by returning smallest integral value not less than parameter. If the parameter is NaN, the result is also NaN.
valuefloatValue to round
For example:
"{ceil|{2.4}}" returns "3.0" (type: float)
"{ceil|{/|{0.0}|{0.0}}}" returns "NaN" (type: float)

date ( year : integer, month : integer, day : integer ) : date
Returns date value that corresponds to given year, month and day of the month. Time of the day is set to 00:00:00.
yearintegerYear number of the date to usemonthintegerMonth number of the date to usedayintegerDay of the month of the date to use
For example:
"{date|{1978}|{09}|{11}}" returns "1978-09-11 00:00:00" (type: date)

date ( year : integer, month : integer, day : integer, hour : integer, minute : integer, minute : integer ) : date
Returns date value that corresponds to given year, month, day of the month and time of the day specified with hour, minute and second.
yearintegerYear number of the date to usemonthintegerMonth number of the date to usedayintegerDay of the month of the date to usehourintegerHour part in time of the day of the date to useminuteintegerMinute part in time of the day of the date to useminuteintegerSecond part in time of the day of the date to use
For example:
"{date|{1978}|{09}|{11}|{17}|{18}|{3}}" returns "1978-09-11 17:18:03" (type: date)

date ( epochMilliseconds : integer ) : date
Returns date value that corresponds to given nonnegative integer value containing number of milliseconds since the Epoch (1970-01-01 00:00:00 UTC).
epochMillisecondsintegerNumber of milliseconds since 1970-01-01 00:00:00 UTC, value to be converted to date
For example:
"{date|{226713600000}}" returns "1977-03-09 00:00:00" (type: date)

day ( date : date ) : integer
Returns day of the month number of given date.
datedateDate to retrieve day of the month number from
For example:
"{day|{@1977-03-09}}" returns "9" (type: integer)

false ( ) : boolean
Returns boolean constant representing logical false value.
For example:
"{false}" returns "false" (type: boolean)

find ( value : string, sub : string ) : integer
Searches given string for another one contained in it and returns its 0-based index. If the second string can't be found in the first one, this function returns -1.
valuestringBase string to search for the substring insubstringSubstring to search for
For example:
"{find|expression language|press}" returns "2" (type: integer)

float ( value : integer ) : float
Converts given integer number to its equivalent of float type.
valueintegerNumber to convert to float type
For example:
"{float|{11}}" returns "11.0" (type: float)

floor ( value : float ) : float
Rounds given number down by returning largest integral value not greater than parameter. If the parameter is NaN, the result is also NaN.
valuefloatValue to round
For example:
"{floor|{2.6}}" returns "2.0" (type: float)
"{floor|{/|{0.0}|{0.0}}}" returns "NaN" (type: float)

format ( format : string, date : date ) : string
Returns string representation of given date generated according to given format specification. Special sequences of characters contained in format specification will be replaced with the appropriate attributes of the date, all other characters will be copied without changes. Special sequence consists of "%" character, followed by one of the following: Sequence consisting of "%" character followed by character not on the list above or single "%" at the end of format string will be left unchanged.
formatstringFormat specification for the resulting stringdatedateDate to represent as a string
For example:
"{format|year: %Y, time: %T, 100%|{@1977-03-09 21:00:00}}" returns "year: 1977, time: 21:00:00, 100%" (type: string)

hour ( date : date ) : integer
Returns hour number of time of the day of given date.
datedateDate to retrieve hour number of time of the day from
For example:
"{hour|{@2005-01-01 02:24:01}}" returns "2" (type: integer)

if ( condition : boolean, value1 : float, value2 : float ) : float
Returns one of two numbers given as parameters, depending on value of condition given as boolean parameter. If the condition is true, the function returns the first number, otherwise it returns the second one.
conditionbooleanValue that determines which number should be returned.value1floatFirst numeric parameter, returned as function's result if condition is true.value2floatSecond numeric parameter, returned as function's result if condition is false.
For example:
"{if|{>|3|1}|{7.5}|{9.0}}" returns "7.5" (type: float)
"{if|{true}|{/|{0.0}|{0.0}}|{9.0}}" returns "NaN" (type: float)

if ( condition : boolean, value1 : string, value2 : string ) : string
Returns one of two given string parameters, depending on value of condition given as boolean parameter. If the condition is true, the function returns the first string, otherwise it returns the second one.
conditionbooleanValue that determines which string should be returned.value1stringFirst string parameter, returned as function's result if condition is true.value2stringSecond string parameter, returned as function's result if condition is false.
For example:
"{if|{>|3|1}|ok|impossible}" returns "ok" (type: string)

if ( condition : boolean, value1 : integer, value2 : integer ) : integer
Returns one of two numbers given as parameters, depending on value of condition given as boolean parameter. If the condition is true, the function returns the first number, otherwise it returns the second one.
conditionbooleanValue that determines which number should be returned.value1integerFirst numeric parameter, returned as function's result if condition is true.value2integerSecond numeric parameter, returned as function's result if condition is false.
For example:
"{if|{>|3|1}|{7}|{9}}" returns "7" (type: integer)

if ( condition : boolean, date1 : date, date2 : date ) : date
Returns one of two given date parameters, depending on value of condition given as boolean parameter. If the condition is true, the function returns the first date, otherwise it returns the second one.
conditionbooleanValue that determines which date should be returned.date1dateFirst date parameter, returned as function's result if condition is true.date2dateSecond date parameter, returned as function's result if condition is false.
For example:
"{if|{>|5|2}|{@1977-03-09}|{@1978-09-11}}" returns "1977-03-09 00:00:00" (type: date)

int ( value : date ) : integer
Converts given date to integer value that contains a number of milliseconds since the Epoch (1970-01-01 00:00:00 UTC) for this date.
valuedateDate to convert to integer type
For example:
"{int|{@1977-03-09 21:00:00}}" returns "226789200000" (type: integer)

int ( value : float ) : integer
Converts given float number to its equivalent of integer type, dropping non-integral part (rounding towards 0). For float values greater than maximum integer value (including positive infinity) this function returns maximum integer: 9223372036854775807. For negative float values less than minimum integer value (including negative infinity) this function returns minimum integer: -9223372036854775808. For NaN value and for float values with absolute value less than 0 this function returns 0.
valuefloatNumber to convert to integer type
For example:
"{int|{-11.0}}" returns "-11" (type: integer)

lcurly ( ) : string
Returns "{" character. This function exists because "{" character can't be used in Wyjec string literals.
For example:
"{lcurly}" returns "{" (type: string)

len ( value : string ) : integer
Returns length (number of characters) of given string.
valuestringString to calculate length for
For example:
"{len|Kowalski}" returns "8" (type: integer)

lower ( value : string ) : string
Returns a copy of string given as parameter with all characters converted to lower case.
valuestringString to convert
For example:
"{lower|Jan Kowalski}" returns "jan kowalski" (type: string)

lpad ( value : string, length : integer, padding : string ) : string
Returns a copy of given string value, prefixing it with padding if its length is smaller than the specified one. Characters from given padding will be repeated if necessary, up to the required length. If given padding is empty, the function will return unmodified string.
valuestringBase string used to generate the new onelengthintegerRequired minimum length of the resulting string.paddingstringString to use for padding.
For example:
"{lpad|test|{10}|._}" returns "._._._test" (type: string)

lstrip ( value : string, stripChars : string ) : string
Returns a copy of given string value with specified characters stripped from its prefix.
valuestringBase string used to generate the new onestripCharsstringString containing characters that are to be stripped from the base string's prefix
For example:
"{lstrip|__.abc.__|._}" returns "abc.__" (type: string)

max ( value : float, optValues : float... ) : float
Returns one of numbers given as parameters such that no other parameter is greater. If any parameter is NaN, the result is also NaN.
valuefloatFirst number used in comparision(optValues)float...Other optional numbers used in comparision
For example:
"{max|{3.0}|{7.0}|{3.5}|{5.0}}" returns "7.0" (type: float)
"{max|{3.0}|{7.0}|{/|{0.0}|{0.0}}|{5.0}}" returns "NaN" (type: float)

max ( value : string, optValues : string... ) : string
Returns one of given parameters such that no other parameter is greater (strings are compared lexicographically).
valuestringFirst value used in comparision(optValues)string...Other optional values used in comparision
For example:
"{max|Jan|Adam|Kowalski|Adam|Janek}" returns "Kowalski" (type: string)

max ( value : integer, optValues : integer... ) : integer
Returns one of numbers given as parameters such that no other parameter is greater.
valueintegerFirst number used in comparision(optValues)integer...Other optional numbers used in comparision
For example:
"{max|{3}|{7}|{3}|{5}}" returns "7" (type: integer)

max ( date : date, optDates : date... ) : date
Returns one of given date parameters such that no other parameter is greater than it. "greater" means here that date represented by a value is after the other one.
datedateFirst date used in comparision(optDates)date...Other optional dates used in comparision
For example:
"{max|{@1978-09-11}|{@1977-03-09}|{@1975-04-09}}" returns "1978-09-11 00:00:00" (type: date)

midnight ( date : date ) : date
Returns date value formed by setting time of the day in given base date to 00:00:00 (midnight).
datedateBase date to use for calculation
For example:
"{midnight|{@2005-01-01 02:24:01}}" returns "2005-01-01 00:00:00" (type: date)

min ( value : float, optValues : float... ) : float
Returns one of numbers given as parameters such that no other parameter is less. If any parameter is NaN, the result is also NaN.
valuefloatFirst number used in comparision(optValues)float...Other optional numbers used in comparision
For example:
"{min|{3.0}|{7.0}|{3.5}|{5.0}}" returns "3.0" (type: float)
"{min|{3.0}|{7.0}|{/|{0.0}|{0.0}}|{5.0}}" returns "NaN" (type: float)

min ( value : string, optValues : string... ) : string
Returns one of given parameters such that no other parameter is less (strings are compared lexicographically).
valuestringFirst value used in comparision(optValues)string...Other optional values used in comparision
For example:
"{min|Jan|Adam|Kowalski|Adam|Janek}" returns "Adam" (type: string)

min ( value : integer, optValues : integer... ) : integer
Returns one of numbers given as parameters such that no other parameter is less.
valueintegerFirst number used in comparision(optValues)integer...Other optional numbers used in comparision
For example:
"{min|{3}|{7}|{3}|{5}}" returns "3" (type: integer)

min ( date : date, optDates : date... ) : date
Returns one of given date parameters such that no other parameter is less than it. "less" means here that date represented by a value is before the other one.
datedateFirst date used in comparision(optDates)date...Other optional dates used in comparision
For example:
"{min|{@1978-09-11}|{@1977-03-09}|{@1975-04-09}}" returns "1975-04-09 00:00:00" (type: date)

minute ( date : date ) : integer
Returns minute number of time of the day of given date.
datedateDate to retrieve minute number of time of the day from
For example:
"{minute|{@2005-01-01 02:24:01}}" returns "24" (type: integer)

mod ( divident : float, divisor : float ) : float
Returns the remainder from division of the first parameter by the second one (modulo operation). If any parameter is NaN or the second one is equal to 0.0, the result is NaN.
dividentfloatValue to divide by divisordivisorfloatValue that divident is to be divided by
For example:
"{%|{7.0}|{2.0}}" returns "1.0" (type: float)
"{%|{/|{0.0}|{0.0}}|{2.0}}" returns "NaN" (type: float)
"{%|{5.0}|{0.0}}" returns "NaN" (type: float)

month ( date : date ) : integer
Returns month number of given date.
datedateDate to retrieve month number from
For example:
"{month|{@1977-03-09}}" returns "3" (type: integer)

not ( value : boolean ) : boolean
Returns negation of a parameter, i.e. boolean false if the parameter is true and boolean false otherwise (logical negation).
valuebooleanValue to negate
For example:
"{not|{false}}" returns "true" (type: boolean)

or ( value : boolean, optValues : boolean... ) : boolean
Returns boolean true if any parameter has value true and boolean false otherwise (logical alternative).
valuebooleanFirst value to use (its value will be copied to result in case its the only parameter)(optValues)boolean...Other optional values to use
For example:
"{or|{false}|{true}|{false}}" returns "true" (type: boolean)

rcurly ( ) : string
Returns "}" character. This function exists because "}" character can't be used in Wyjec string literals.
For example:
"{rcurly}" returns "}" (type: string)

repeat ( value : string, repetitions : integer ) : string
Generates new string by concatenating together specified number of copies of given string. For negative number of repetitions the function returns an empty string.
valuestringBase string used to generate the new onerepetitionsintegerNumber of repetitions of the base string
For example:
"{repeat|**|{3}}" returns "******" (type: string)

replace ( value : string, oldSub : string, newSub : string ) : string
Returns modified copy of given string, such as all non-overlapping occurrences of another given string are replaced with specified replacement. If substring to be replaced is empty, the function will return unmodified string.
valuestringBase string to perform replacement onoldSubstringOld substring to search for in the base stringnewSubstringNew substring to use as a replacement for occurrences of old substring
For example:
"{replace|free culture|e|**}" returns "fr**** cultur**" (type: string)

reverse ( value : string ) : string
Returns copy of string given as parameter with characters in reverse order.
valuestringString to convert
For example:
"{reverse|Kowalski}" returns "ikslawoK" (type: string)

rpad ( value : string, length : integer, padding : string ) : string
Returns a copy of given string value, followed with padding if its length is smaller than the specified one. Characters from given padding will be repeated if necessary, up to the required length. If given padding is empty, the function will return unmodified string.
valuestringBase string used to generate the new onelengthintegerRequired minimum length of the resulting string.paddingstringString to use for padding.
For example:
"{rpad|test|{9}|._}" returns "test._._." (type: string)

rstrip ( value : string, stripChars : string ) : string
Returns a copy of given string value with specified characters stripped from its suffix.
valuestringBase string used to generate the new onestripCharsstringString containing characters that are to be stripped from the base string's suffix
For example:
"{rstrip|__.abc.__|._}" returns "__.abc" (type: string)

second ( date : date ) : integer
Returns second number of time of the day of given date.
datedateDate to retrieve second number of time of the day from
For example:
"{second|{@2005-01-01 02:24:01}}" returns "1" (type: integer)

select ( defaultValue : float, selector : integer, optValues : float... ) : float
Returns one of given numbers depending on value of selector. Selector specifies 0-based index of number from given sequence of optional number. In case index is negative or too big, default number is returned.
defaultValuefloatDefault number used as result of the function in case selector is negative or greater than length of sequence of numbersselectorintegerIndex of value from sequence of numbers to return as result(optValues)float...Optional sequence of numbers to select single value from (may be empty)
For example:
"{select|{0.0}|{3}|{10.0}|{10.5}|{11.0}|{11.5}|{12.0}}" returns "11.5" (type: float)
"{select|{0.0}|{1}|{10.0}|{10.5}|{/|{0.0}|{0.0}}}" returns "10.5" (type: float)

select ( defaultValue : string, selector : integer, optValues : string... ) : string
Returns one of given strings depending on value of selector. Selector specifies 0-based index of string from given sequence of optional strings. In case index is negative or too big, default string is returned.
defaultValuestringDefault string used as result of the function in case selector is negative or greater than length of sequence of stringsselectorintegerIndex of value from sequence of strings to return as result(optValues)string...Optional sequence of strings to select single value from (may be empty)
For example:
"{select|unknown|{3}|zero|one|two|three|four}" returns "three" (type: string)

select ( defaultValue : integer, selector : integer, optValues : integer... ) : integer
Returns one of given numbers depending on value of selector. Selector specifies 0-based index of number from given sequence of optional number. In case index is negative or too big, default number is returned.
defaultValueintegerDefault number used as result of the function in case selector is negative or greater than length of sequence of numbersselectorintegerIndex of value from sequence of numbers to return as result(optValues)integer...Optional sequence of numbers to select single value from (may be empty)
For example:
"{select|{0}|{3}|{10}|{11}|{12}|{13}|{14}}" returns "13" (type: integer)

select ( defaultDate : date, selector : integer, optDates : date... ) : date
Returns one of given dates depending on value of selector. Selector specifies 0-based index of date from given sequence of optional dates. In case index is negative or too big, default date is returned.
defaultDatedateDefault date used as result of the function in case selector is negative or greater than length of sequence of datesselectorintegerIndex of value from sequence of dates to return as result(optDates)date...Optional sequence of dates to select single value from (may be empty)
For example:
"{select|{@2005-01-01}|{1}|{@1978-09-11}|{@1977-03-09}|{@1975-04-09}}" returns "1977-03-09 00:00:00" (type: date)

str ( value : float ) : string
Returns string representation of number given as a parameter. For NaN it returns "NaN".
valuefloatNumber to represent as a string
For example:
"{str|{11.5}}" returns "11.5" (type: string)
"{str|{/|{0.0}|{0.0}}}" returns "NaN" (type: string)

str ( value : integer ) : string
Returns string representation of number given as a parameter. It consists of decimal digits, optionally preceded by minus sign (in case of negative numbers).
valueintegerNumber to represent as a string
For example:
"{str|{11}}" returns "11" (type: string)

str ( date : date ) : string
Returns string representation of date given as a parameter. It consists of date and time of the day separated by space, both given in format specified by ISO 8601 standard.
datedateDate to represent as a string
For example:
"{str|{@1977-03-09 21:00:00}}" returns "1977-03-09 21:00:00" (type: string)

str ( value : boolean ) : string
Returns string representation of a parameter: "true" for boolean true and "false" for boolean false.
valuebooleanValue to generate a string for
For example:
"{str|{false}}" returns "false" (type: string)

substr ( value : string, subStart : integer, subLength : integer ) : string
Returns substring of given string. Substring is specified with 0-based index of its first character and its length, where negative indices allow for counting characters from the end of the string). Invalid indices will be bound to the nearest end of the string. Negative length will be treated as zero.
valuestringString to generate a substring fromsubStartintegerIndex of first character to include in the substringsubLengthintegerLength (number of characters) of the substring
For example:
"{substr|Kowalski|{4}|{2}}" returns "ls" (type: string)

true ( ) : boolean
Returns boolean constant representing logical true value.
For example:
"{true}" returns "true" (type: boolean)

upper ( value : string ) : string
Returns a copy of string given as parameter with all characters converted to upper case.
valuestringString to convert
For example:
"{upper|Kowalski}" returns "KOWALSKI" (type: string)

vbar ( ) : string
Returns "|" character. This function exists because "|" character can't be used in Wyjec string literals.
For example:
"{vbar}" returns "|" (type: string)

year ( date : date ) : integer
Returns year number of given date.
datedateDate to retrieve year number from
For example:
"{year|{@1977-03-09}}" returns "1977" (type: integer)