Class StandardFunctions
All contexts that are used in the formula engine should inherit from this base class that provides a set of common functions that can be used simply in formulas
Inherited Members
Namespace: LemonEdge.Utils
Assembly: LemonEdge.Utils.dll
Syntax
public class StandardFunctions
Constructors
StandardFunctions()
Declaration
public StandardFunctions()
Properties
TempValue1
A temporary value for storing calculations
Declaration
public object? TempValue1 { get; set; }
Property Value
Type | Description |
---|---|
object |
Methods
Abs(double)
Returns the absolute value of a given number
Declaration
[FormulaFunction(Name = "Abs", Type = "Mathematical Operator", Description = "Returns the absolute value of a specified number.", Params = "1. The number to return the ABS of.", ParamCount = 1)]
public double Abs(double val)
Parameters
Type | Name | Description |
---|---|---|
double | val | The number to return the absolute value of |
Returns
Type | Description |
---|---|
double | The absolute value of a given number |
And(bool, bool)
Returns true if value a
and value b
are both true
Declaration
public bool And(bool a, bool b)
Parameters
Type | Name | Description |
---|---|---|
bool | a | The first value to check if it holds true |
bool | b | The second value to check if it holds true |
Returns
Type | Description |
---|---|
bool | True if both value |
BeginningOfDay(DateTime)
Returns the specified date with a time component set to the beginning of the day (00:00:00.1)
Declaration
[FormulaFunction(Name = "BeginningOfDay", Type = "Date", Description = "Returns the date time for the beginning of the day given by the specified date.", Params = "1. The specified date to return the beginning of the day date time for.", ParamCount = 1)]
public DateTime BeginningOfDay(DateTime dt)
Parameters
Type | Name | Description |
---|---|---|
DateTime | dt | The date to return the start of the day for |
Returns
Type | Description |
---|---|
DateTime | The start of the day for the specified |
BeginningOfMonth(DateTime)
Returns the date for the beginning of the month of a specified date
Declaration
[FormulaFunction(Name = "BeginningOfMonth", Type = "Date", Description = "Returns the date for the start of the month given by the specified date.", Params = "1. The specified date to return the start of month date for.", ParamCount = 1)]
public DateTime BeginningOfMonth(DateTime dt)
Parameters
Type | Name | Description |
---|---|---|
DateTime | dt | The date to return the beginning of the month of |
Returns
Type | Description |
---|---|
DateTime | The date of the beginning of the month for the specified |
BeginningOfWeek(DateTime)
Returns the date for the start of the week (with Monday as the start) for the specified date
Declaration
[FormulaFunction(Name = "BeginningOfWeek", Type = "Date", Description = "Returns the date for the start of the week (with Monday as the start) given by the specified date.", Params = "1. The specified date to return the start of week date for.", ParamCount = 1)]
public DateTime BeginningOfWeek(DateTime dt)
Parameters
Type | Name | Description |
---|---|---|
DateTime | dt | The date to return the start of the week for |
Returns
Type | Description |
---|---|
DateTime | The date of the start of the week for the specified |
BeginningOfYear(DateTime)
Returns the date for the beginning of the year for the specified date
Declaration
[FormulaFunction(Name = "BeginningOfYear", Type = "Date", Description = "Returns the date for the beginning of the year given by the specified date.", Params = "1. The specified date to return the beginning of year date for.", ParamCount = 1)]
public DateTime BeginningOfYear(DateTime dt)
Parameters
Type | Name | Description |
---|---|---|
DateTime | dt | The date to return the beginning of the year for |
Returns
Type | Description |
---|---|
DateTime | The date of the beginning of the year for the specified |
Ceiling(decimal)
Returns the smallest integral value greater than or equal to the specified d
value
Declaration
[FormulaFunction(Name = "Ceiling", Type = "Mathematical Operator", Description = "Rounds the number up to the nearest whole number.", Params = "1. The decimal to round up.", ParamCount = 1)]
public decimal Ceiling(decimal d)
Parameters
Type | Name | Description |
---|---|---|
decimal | d | The value to return the ceiling operation of |
Returns
Type | Description |
---|---|
decimal | The smallest integral value greater than or equal to |
ChCR()
Returns a carriage return
Declaration
[FormulaFunction(Name = "ChCR", Type = "String", Description = "Returns a Character Return character.", Params = "", ParamCount = 0)]
public string ChCR()
Returns
Type | Description |
---|---|
string | A carriage return |
ChCRLF()
Returns a carriage return and line feed - essentially a new line
Declaration
[FormulaFunction(Name = "ChCRLF", Type = "String", Description = "Returns a Character Return Line Feed character.", Params = "", ParamCount = 0)]
public string ChCRLF()
Returns
Type | Description |
---|---|
string | A new line |
ChLF()
Returns a line feed
Declaration
[FormulaFunction(Name = "ChLF", Type = "String", Description = "Returns a Character Line Feed character.", Params = "", ParamCount = 0)]
public string ChLF()
Returns
Type | Description |
---|---|
string | A line feed |
Chr(int)
Returns the character associated with the specified character code
Declaration
[FormulaFunction(Name = "Chr", Type = "Char", Description = "Returns the character associated with the specified character code.", Params = "1. The numbered character code.", ParamCount = 1)]
public char Chr(int c)
Parameters
Type | Name | Description |
---|---|---|
int | c | The character code to return the character of |
Returns
Type | Description |
---|---|
char | A character matching the supplied |
Contains(string, string)
Returns a value indicating if a specified string s2
exists within the string
s1
Declaration
[FormulaFunction(Name = "Contains", Type = "String", Description = "Returns a value indicating whether a specified substring (param=s2) occurs within this string (param=s1).", Params = "1. The string to seek through.\r\n2. The string to seek for", ParamCount = 2)]
public bool Contains(string s1, string s2)
Parameters
Type | Name | Description |
---|---|---|
string | s1 | The string to see if any instances of |
string | s2 | The string to search for within |
Returns
Type | Description |
---|---|
bool | True if |
Cos(double)
Returns the cosine of the specified angle
Declaration
[FormulaFunction(Name = "Cos", Type = "Mathematical Operator", Description = "Performs a Cos mathematical operation.", Params = "1. Number to perform Cos operation on.", ParamCount = 1)]
public double Cos(double v)
Parameters
Type | Name | Description |
---|---|---|
double | v | The angle to return the cosine of |
Returns
Type | Description |
---|---|
double | The cosine of |
Date(int, int, int)
Returns a datetime representation of the given year
, month
,
day
Declaration
[FormulaFunction(Name = "Date", Type = "Date", Description = "Returns a valid date from the specified values.", Params = "1. The year of the date.\r\n3. The month of the date.\r\n3. The day of the date.", ParamCount = 3)]
public DateTime Date(int year, int month, int day)
Parameters
Type | Name | Description |
---|---|---|
int | year | The year for the date |
int | month | The month for the date |
int | day | The day of the date |
Returns
Type | Description |
---|---|
DateTime | A valid datetime of the given |
DateAdd(DateTime, DateTime)
Returns a new date created by taking the date component of the first datetime and combining it with the time component of the second date
Declaration
[FormulaFunction(Name = "DateAdd", Type = "Date", Description = "Returns a date made from a date value and a time value.", Params = "1. The date value.\r\n2. The time value.", ParamCount = 2)]
public DateTime DateAdd(DateTime dateValue, DateTime timeValue)
Parameters
Type | Name | Description |
---|---|---|
DateTime | dateValue | The date value to have a time component added to it |
DateTime | timeValue | The time component to combine with the date component |
Returns
Type | Description |
---|---|
DateTime | A new date from combining the first date with the second time component |
DateAdd(DateTime, decimal, decimal, decimal)
Returns the specified date
with the supplied years
,
months
, days
added to it
Declaration
[FormulaFunction(Name = "DateAdd", Type = "Date", Description = "Returns the date with the specified years, months, days added to it.", Params = "1. The date to add values to.\r\n2. The amount of years to add to the date.\r\n3. The amount of months to add to the date.\r\n4. The amount of days to add to the date.", ParamCount = 4)]
public DateTime DateAdd(DateTime date, decimal years, decimal months, decimal days)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date | The date to add years, months and/or days to |
decimal | years | The amount of years to add to the given |
decimal | months | The amount of months to add to the given |
decimal | days | The amount of days to add to the given |
Returns
Type | Description |
---|---|
DateTime | A new date with the supplied years, months and days added to it |
DateAdd(DateTimeOffset, decimal, decimal, decimal)
Returns the specified date
with the supplied years
,
months
, days
added to it
Declaration
[FormulaFunction(Name = "DateAdd", Type = "Date", Description = "Returns the date with the specified years, months, days added to it.", Params = "1. The date to add values to.\r\n2. The amount of years to add to the date.\r\n3. The amount of months to add to the date.\r\n4. The amount of days to add to the date.", ParamCount = 4)]
public DateTimeOffset DateAdd(DateTimeOffset date, decimal years, decimal months, decimal days)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | date | The date to add years, months and/or days to |
decimal | years | The amount of years to add to the given |
decimal | months | The amount of months to add to the given |
decimal | days | The amount of days to add to the given |
Returns
Type | Description |
---|---|
DateTimeOffset | A new date with the supplied years, months and days added to it |
DateAddWorkDays(DateTime, decimal)
Returns the specified date
with the supplied work days
added to it
(excludes saturdays and sundays)
Declaration
[FormulaFunction(Name = "DateAddWorkDays", Type = "Date", Description = "Returns the date with the specified work days (excluding saturdays/sundays) added to it.", Params = "1. The date to add values to.\r\n2. The amount of work days to add to the date.", ParamCount = 2)]
public DateTime DateAddWorkDays(DateTime date, decimal days)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date | The date to add the specified work days to |
decimal | days | The amount of work days (excluding sat/sun) to add to the specified date |
Returns
Type | Description |
---|---|
DateTime | A new date with the specified number of work days added to the original date |
Day(DateTime)
Returns the day value of a given date
Declaration
[FormulaFunction(Name = "Day", Type = "Date", Description = "Retrieves the day of the specified date.", Params = "1. The date value.", ParamCount = 1)]
public int Day(DateTime d)
Parameters
Type | Name | Description |
---|---|---|
DateTime | d | The date to get the day value of |
Returns
Type | Description |
---|---|
int | The day of a given date |
DayDifference(DateTime, DateTime)
Returns the number of days between any two given dates
Declaration
[FormulaFunction(Name = "DayDifference", Type = "Date", Description = "Returns the number of days between two dates.", Params = "1. The date to subtract the next date from.\r\n2. The 2nd date.", ParamCount = 2)]
public decimal DayDifference(DateTime date1, DateTime date2)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date1 | The first date to find the number of days difference with |
DateTime | date2 | The second date to find the numbers of days difference with |
Returns
Type | Description |
---|---|
decimal | The number of days between |
DayDifferenceWorkDays(DateTime, DateTime)
Returns the number of work days between any two given dates excluding saturdays and sundays from the calculation
Declaration
[FormulaFunction(Name = "DayDifferenceWorkDays", Type = "Date", Description = "Returns the number of days between two dates excluding saturdays and sundays.", Params = "1. The date to subtract the next date from.\r\n2. The 2nd date.", ParamCount = 2)]
public decimal DayDifferenceWorkDays(DateTime date1, DateTime date2)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date1 | The first date to find the number of work days difference with |
DateTime | date2 | The second date to find the numbers of work days difference with |
Returns
Type | Description |
---|---|
decimal | The number of work days (excludes saturdays and sundays) between |
Dec(object)
Converts the specified value to a decimal representation
Declaration
[FormulaFunction(Name = "Dec", Type = "Mathematical Operator", Description = "Converts the specified value to a decimal.", Params = "1. The value to return as a decimal.", ParamCount = 1)]
public decimal Dec(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value | The value to return in decimal form |
Returns
Type | Description |
---|---|
decimal | A decimal representation of the supplied |
EndOfDay(DateTime)
Returns the specified date with a time component set to the end of the day (23:59:59.999)
Declaration
[FormulaFunction(Name = "EndOfDay", Type = "Date", Description = "Returns the date time for the end of the day given by the specified date.", Params = "1. The specified date to return the end of the day date time for.", ParamCount = 1)]
public DateTime EndOfDay(DateTime dt)
Parameters
Type | Name | Description |
---|---|---|
DateTime | dt | The date to return the end of the day for |
Returns
Type | Description |
---|---|
DateTime | The end of the day for the specified |
EndOfMonth(DateTime)
Returns the date for the end of the month of a specified date
Declaration
[FormulaFunction(Name = "EndOfMonth", Type = "Date", Description = "Returns the date for the end of the month given by the specified date.", Params = "1. The specified date to return the end of month date for.", ParamCount = 1)]
public DateTime EndOfMonth(DateTime dt)
Parameters
Type | Name | Description |
---|---|---|
DateTime | dt | The date to return the end of the month of |
Returns
Type | Description |
---|---|
DateTime | The date of the end of the month for the specified |
EndOfYear(DateTime)
Returns the date for the end of the year for the specified date
Declaration
[FormulaFunction(Name = "EndOfYear", Type = "Date", Description = "Returns the date for the end of the year given by the specified date.", Params = "1. The specified date to return the end of year date for.", ParamCount = 1)]
public DateTime EndOfYear(DateTime dt)
Parameters
Type | Name | Description |
---|---|---|
DateTime | dt | The date to return the end of the year for |
Returns
Type | Description |
---|---|
DateTime | The date of the end of the year for the specified |
Floor(decimal)
Returns the largest integral value less than or equal to the specified d
value
Declaration
[FormulaFunction(Name = "Floor", Type = "Mathematical Operator", Description = "Rounds the number down to the nearest whole number.", Params = "1. The decimal to round down.", ParamCount = 1)]
public decimal Floor(decimal d)
Parameters
Type | Name | Description |
---|---|---|
decimal | d | The value to return the floor operation of |
Returns
Type | Description |
---|---|
decimal | The largest integral value less than or equal to |
Format(object, string)
Formats the given value
according to the specified format style
Declaration
[FormulaFunction(Name = "Format", Type = "String", Description = "Returns the format of a specified value.", Params = "1. The value to format.\r\n2. The format style to apply (see http://msdn.microsoft.com/en-us/library/fbxft59x(v=vs.80).aspx).", ParamCount = 2)]
public string Format(object value, string style)
Parameters
Type | Name | Description |
---|---|---|
object | value | The value to be formatted. Must be a decimal or datetime to apply formatting to. |
string | style | The formatting to be applied when returning the |
Returns
Type | Description |
---|---|
string | The specified |
FormatAsString(object)
Declaration
protected string FormatAsString(object val)
Parameters
Type | Name | Description |
---|---|---|
object | val |
Returns
Type | Description |
---|---|
string |
FormatDate(DateTime, string)
Returns the specified datetime formatted according to the specified format fmt
Declaration
[FormulaFunction(Name = "FormatDate", Type = "Date", Description = "Returns date in a specified format.", Params = "1. The date to return as a formatted string.\r\n2. The format style.", ParamCount = 2)]
public string FormatDate(DateTime d, string fmt = null)
Parameters
Type | Name | Description |
---|---|---|
DateTime | d | The date to return as a formatted string |
string | fmt | The format to apply when displaying the datetime as a string |
Returns
Type | Description |
---|---|
string | A formatted representation of the supplied datetime |
HourDifference(DateTime, DateTime)
Returns the number of hours between two dates
Declaration
[FormulaFunction(Name = "HourDifference", Type = "Date", Description = "Returns the number of hours between two dates.", Params = "1. The date to subtract the next date from.\r\n2. The 2nd date.", ParamCount = 2)]
public decimal HourDifference(DateTime date1, DateTime date2)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date1 | The first date to find the number of hours difference with |
DateTime | date2 | The second date to find the numbers of hours difference with |
Returns
Type | Description |
---|---|
decimal | The number of hours between |
If(bool, object, object)
A logical comparisson. If the cond
is true then TrueValue
is returned, else
FalseValue
is returned
Declaration
[FormulaFunction(Name = "If", Type = "Other", Description = "Evaluates a specified condition as true or false. Returns the corrosponding true or false part of the statement.", Params = "1. The condition to evaluate for true or false.\r\n2. The true value to return if the condition is true.\r\n3. The false value to return if the condition is false.", ParamCount = 3)]
public object If(bool cond, object TrueValue, object FalseValue)
Parameters
Type | Name | Description |
---|---|---|
bool | cond | The condition to check for being true |
object | TrueValue | Returned if |
object | FalseValue | Returned if |
Returns
Type | Description |
---|---|
object |
|
Int(object)
Converts the specified value to an integer representation
Declaration
[FormulaFunction(Name = "Int", Type = "Mathematical Operator", Description = "Converts the specified value to an integer.", Params = "1. The value to return as an integer.", ParamCount = 1)]
public int Int(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value | The value to return in integer form |
Returns
Type | Description |
---|---|
int | An integer representation of the supplied |
IsBlank(string)
Returns true if the specified value is null or empty
Declaration
[FormulaFunction(Name = "IsBlank", Type = "String", Description = "Returns True if the given string is empty, or contains only character returns and blank spaces.", Params = "1. The string to check if it is blank.", ParamCount = 1)]
public bool IsBlank(string item)
Parameters
Type | Name | Description |
---|---|---|
string | item | The value to evaluate against being empty |
Returns
Type | Description |
---|---|
bool | True if the string is null or empty. False otherwise |
IsIn(object, object)
Returns true if searchFor
is equal to any of the trailing item arguments
Declaration
[FormulaFunction(Name = "IsIn", Type = "Other", Description = "Returns True if the first argument is contained within any of the following arguments, False otherwise.", Params = "1. The value to compare.\r\n2. The first possible value.\r\n3. Optional - any further values to compare.\r\n", ParamCount = 3)]
public bool IsIn(object searchFor, object item1)
Parameters
Type | Name | Description |
---|---|---|
object | searchFor | The item to check if is in any of the item arguments |
object | item1 | An argument to check if is equal to |
Returns
Type | Description |
---|---|
bool | True if |
IsIn(object, object, object)
Returns true if searchFor
is equal to any of the trailing item arguments
Declaration
public bool IsIn(object searchFor, object item1, object item2)
Parameters
Type | Name | Description |
---|---|---|
object | searchFor | The item to check if is in any of the item arguments |
object | item1 | An argument to check if is equal to |
object | item2 | An argument to check if is equal to |
Returns
Type | Description |
---|---|
bool | True if |
IsIn(object, object, object, object)
Returns true if searchFor
is equal to any of the trailing item arguments
Declaration
public bool IsIn(object searchFor, object item1, object item2, object item3)
Parameters
Type | Name | Description |
---|---|---|
object | searchFor | The item to check if is in any of the item arguments |
object | item1 | An argument to check if is equal to |
object | item2 | An argument to check if is equal to |
object | item3 | An argument to check if is equal to |
Returns
Type | Description |
---|---|
bool | True if |
IsIn(object, object, object, object, object)
Returns true if searchFor
is equal to any of the trailing item arguments
Declaration
public bool IsIn(object searchFor, object item1, object item2, object item3, object item4)
Parameters
Type | Name | Description |
---|---|---|
object | searchFor | The item to check if is in any of the item arguments |
object | item1 | An argument to check if is equal to |
object | item2 | An argument to check if is equal to |
object | item3 | An argument to check if is equal to |
object | item4 | An argument to check if is equal to |
Returns
Type | Description |
---|---|
bool | True if |
IsIn(object, object, object, object, object, object)
Returns true if searchFor
is equal to any of the trailing item arguments
Declaration
public bool IsIn(object searchFor, object item1, object item2, object item3, object item4, object item5)
Parameters
Type | Name | Description |
---|---|---|
object | searchFor | The item to check if is in any of the item arguments |
object | item1 | An argument to check if is equal to |
object | item2 | An argument to check if is equal to |
object | item3 | An argument to check if is equal to |
object | item4 | An argument to check if is equal to |
object | item5 | An argument to check if is equal to |
Returns
Type | Description |
---|---|
bool | True if |
IsIn(object, object, object, object, object, object, object)
Returns true if searchFor
is equal to any of the trailing item arguments
Declaration
public bool IsIn(object searchFor, object item1, object item2, object item3, object item4, object item5, object item6)
Parameters
Type | Name | Description |
---|---|---|
object | searchFor | The item to check if is in any of the item arguments |
object | item1 | An argument to check if is equal to |
object | item2 | An argument to check if is equal to |
object | item3 | An argument to check if is equal to |
object | item4 | An argument to check if is equal to |
object | item5 | An argument to check if is equal to |
object | item6 | An argument to check if is equal to |
Returns
Type | Description |
---|---|
bool | True if |
IsIn(object, object, object, object, object, object, object, object)
Returns true if searchFor
is equal to any of the trailing item arguments
Declaration
public bool IsIn(object searchFor, object item1, object item2, object item3, object item4, object item5, object item6, object item7)
Parameters
Type | Name | Description |
---|---|---|
object | searchFor | The item to check if is in any of the item arguments |
object | item1 | An argument to check if is equal to |
object | item2 | An argument to check if is equal to |
object | item3 | An argument to check if is equal to |
object | item4 | An argument to check if is equal to |
object | item5 | An argument to check if is equal to |
object | item6 | An argument to check if is equal to |
object | item7 | An argument to check if is equal to |
Returns
Type | Description |
---|---|
bool | True if |
IsIn(object, object, object, object, object, object, object, object, object)
Returns true if searchFor
is equal to any of the trailing item arguments
Declaration
public bool IsIn(object searchFor, object item1, object item2, object item3, object item4, object item5, object item6, object item7, object item8)
Parameters
Type | Name | Description |
---|---|---|
object | searchFor | The item to check if is in any of the item arguments |
object | item1 | An argument to check if is equal to |
object | item2 | An argument to check if is equal to |
object | item3 | An argument to check if is equal to |
object | item4 | An argument to check if is equal to |
object | item5 | An argument to check if is equal to |
object | item6 | An argument to check if is equal to |
object | item7 | An argument to check if is equal to |
object | item8 | An argument to check if is equal to |
Returns
Type | Description |
---|---|
bool | True if |
IsIn(object, object, object, object, object, object, object, object, object, object)
Returns true if searchFor
is equal to any of the trailing item arguments
Declaration
public bool IsIn(object searchFor, object item1, object item2, object item3, object item4, object item5, object item6, object item7, object item8, object item9)
Parameters
Type | Name | Description |
---|---|---|
object | searchFor | The item to check if is in any of the item arguments |
object | item1 | An argument to check if is equal to |
object | item2 | An argument to check if is equal to |
object | item3 | An argument to check if is equal to |
object | item4 | An argument to check if is equal to |
object | item5 | An argument to check if is equal to |
object | item6 | An argument to check if is equal to |
object | item7 | An argument to check if is equal to |
object | item8 | An argument to check if is equal to |
object | item9 | An argument to check if is equal to |
Returns
Type | Description |
---|---|
bool | True if |
IsIn(object, object, object, object, object, object, object, object, object, object, object)
Returns true if searchFor
is equal to any of the trailing item arguments
Declaration
public bool IsIn(object searchFor, object item1, object item2, object item3, object item4, object item5, object item6, object item7, object item8, object item9, object item10)
Parameters
Type | Name | Description |
---|---|---|
object | searchFor | The item to check if is in any of the item arguments |
object | item1 | An argument to check if is equal to |
object | item2 | An argument to check if is equal to |
object | item3 | An argument to check if is equal to |
object | item4 | An argument to check if is equal to |
object | item5 | An argument to check if is equal to |
object | item6 | An argument to check if is equal to |
object | item7 | An argument to check if is equal to |
object | item8 | An argument to check if is equal to |
object | item9 | An argument to check if is equal to |
object | item10 | An argument to check if is equal to |
Returns
Type | Description |
---|---|
bool | True if |
IsNull(object)
Indicates if the specified value
is equal to null
Declaration
[FormulaFunction(Name = "IsNull", Type = "Other", Description = "Returns true if the value is null.", Params = "", ParamCount = 0)]
public bool IsNull(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value | The value to check if it is null |
Returns
Type | Description |
---|---|
bool | True if the |
Len(string)
Returns the length of a given string
Declaration
[FormulaFunction(Name = "Len", Type = "String", Description = "Returns the length of a specified string.", Params = "1. The string to return the length of.", ParamCount = 1)]
public int Len(string str)
Parameters
Type | Name | Description |
---|---|---|
string | str | The string to return the length of |
Returns
Type | Description |
---|---|
int | The length of a given string |
Lower(string)
Returns a given string in all lowercase
Declaration
[FormulaFunction(Name = "Lower", Type = "String", Description = "Returns the specified string in lower case.", Params = "1. The string to return in lower case.", ParamCount = 1)]
public string Lower(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | The string to be converted to all lowercase |
Returns
Type | Description |
---|---|
string | A lowercase version of the |
Max(double, double, double, double, double)
Returns the maximum number from the set of supplied numbers
Declaration
[FormulaFunction(Name = "Max", Type = "Mathematical Operator", Description = "Returns the highest of two numbers.", Params = "1. A number, which if the highest will be returned.\r\n2. A number, which if the highest will be returned.", ParamCount = 2)]
public double Max(double v1, double v2, double v3 = -1.7976931348623157E+308, double v4 = -1.7976931348623157E+308, double v5 = -1.7976931348623157E+308)
Parameters
Type | Name | Description |
---|---|---|
double | v1 | A number to be returned if it is the largest number from all supplied numbers |
double | v2 | A number to be returned if it is the largest number from all supplied numbers |
double | v3 | A number to be returned if it is the largest number from all supplied numbers |
double | v4 | A number to be returned if it is the largest number from all supplied numbers |
double | v5 | A number to be returned if it is the largest number from all supplied numbers |
Returns
Type | Description |
---|---|
double | The number that is the largest number from all supplied numbers |
Min(double, double, double, double, double)
Returns the minimum number from the set of supplied numbers
Declaration
[FormulaFunction(Name = "Min", Type = "Mathematical Operator", Description = "Return the lower of two numbers.", Params = "1. A number, which if the lowest will be returned.\r\n2. A number, which if the lowest will be returned.", ParamCount = 2)]
public double Min(double v1, double v2, double v3 = 1.7976931348623157E+308, double v4 = 1.7976931348623157E+308, double v5 = 1.7976931348623157E+308)
Parameters
Type | Name | Description |
---|---|---|
double | v1 | A number to be returned if it is the lowest number from all supplied numbers |
double | v2 | A number to be returned if it is the lowest number from all supplied numbers |
double | v3 | A number to be returned if it is the lowest number from all supplied numbers |
double | v4 | A number to be returned if it is the lowest number from all supplied numbers |
double | v5 | A number to be returned if it is the lowest number from all supplied numbers |
Returns
Type | Description |
---|---|
double | The number that is the lowest number from all supplied numbers |
MinuteDifference(DateTime, DateTime)
Returns the number of minutes between two dates
Declaration
[FormulaFunction(Name = "MinuteDifference", Type = "Date", Description = "Returns the number of minutes between two dates.", Params = "1. The date to subtract the next date from.\r\n2. The 2nd date.", ParamCount = 2)]
public decimal MinuteDifference(DateTime date1, DateTime date2)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date1 | The first date to find the number of minutes difference with |
DateTime | date2 | The second date to find the numbers of minutes difference with |
Returns
Type | Description |
---|---|
decimal | The number of minutes between |
Mod(double, double)
Returns the modulus of x
% y
Declaration
[FormulaFunction(Name = "Mod", Type = "Mathematical Operator", Description = "Returns the modular of a specified number.", Params = "1. The number to provide a modular of.\r\n2. The modular to apply.", ParamCount = 2)]
public double Mod(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
double | x | The x argument for the mod operation |
double | y | The y argument for the mod operation |
Returns
Type | Description |
---|---|
double |
|
Money(object)
Returns the specified number as a money formatted string
Declaration
[FormulaFunction(Name = "Money", Type = "String", Description = "Returns the specified number as a money formatted string.", Params = "1. The number to return in money format.", ParamCount = 1)]
public string Money(object d)
Parameters
Type | Name | Description |
---|---|---|
object | d | The number to return as a money formatted string |
Returns
Type | Description |
---|---|
string | A money formatted string representation of the provided number |
Month(DateTime)
Returns the month value of a given date
Declaration
[FormulaFunction(Name = "Month", Type = "Date", Description = "Retrieves the month of the specified date.", Params = "1. The date value.", ParamCount = 1)]
public int Month(DateTime d)
Parameters
Type | Name | Description |
---|---|---|
DateTime | d | The date to get the month value of |
Returns
Type | Description |
---|---|
int | The month of a given date |
Not(bool)
Returns the opposite of the a
value
Declaration
public bool Not(bool a)
Parameters
Type | Name | Description |
---|---|---|
bool | a | The value to return the opposite of |
Returns
Type | Description |
---|---|
bool | True if the passed |
Now()
Returns the current date time
Declaration
[FormulaFunction(Name = "Now", Type = "Date", Description = "Returns todays date and time.", Params = "", ParamCount = 0)]
public DateTime Now()
Returns
Type | Description |
---|---|
DateTime | The current date time |
Null()
Returns the null value
Declaration
[FormulaFunction(Name = "Null", Type = "Other", Description = "Returns a null value.", Params = "", ParamCount = 0)]
public object Null()
Returns
Type | Description |
---|---|
object | The null value |
NullDate()
Returns a null date value
Declaration
[FormulaFunction(Name = "NullDate", Type = "Date", Description = "Returns a null date.", Params = "", ParamCount = 0)]
public DateTime NullDate()
Returns
Type | Description |
---|---|
DateTime | A null date value |
NullDateTimeOffset()
Returns a null date offset value
Declaration
[FormulaFunction(Name = "NullDateTimeOffset", Type = "Date", Description = "Returns a null date time offset.", Params = "", ParamCount = 0)]
public DateTimeOffset NullDateTimeOffset()
Returns
Type | Description |
---|---|
DateTimeOffset | A null date offset value |
Or(bool, bool)
Returns true if either value a
or b
is true
Declaration
public bool Or(bool a, bool b)
Parameters
Type | Name | Description |
---|---|---|
bool | a | The first value to check if it holds true |
bool | b | The second value to check if it hold true |
Returns
Type | Description |
---|---|
bool | True if either value |
PadLeft(string, int, char)
Returns a new string by padding the start of this string with the specified paddingChar
to
create a string with the specified totalWidth
Declaration
[FormulaFunction(Name = "PadLeft", Type = "String", Description = "Right aligns the characters in the specified string by padding a specified string a certain number of times.", Params = "1. The string to pad.\r\n2. The number of characters for the total lenght of the string.\r\n3. The string to use as padding.", ParamCount = 3)]
public string PadLeft(string str, int totalWidth, char paddingChar = ' ')
Parameters
Type | Name | Description |
---|---|---|
string | str | The string to pad the start with |
int | totalWidth | The total length of the returned string |
char | paddingChar | The character to repeatedly pad the start of the string with until it is equal to the
|
Returns
Type | Description |
---|---|
string | A new string that has a total length of |
PadRight(string, int, char)
Returns a new string by padding the end of this string with the specified paddingChar
to create
a string with the specified totalWidth
Declaration
[FormulaFunction(Name = "PadRight", Type = "String", Description = "Left aligns the characters in the specified string by padding a specified string a certain number of times.", Params = "1. The string to pad.\r\n2. The number of characters for the total lenght of the string.\r\n3. The string to use as padding.", ParamCount = 3)]
public string PadRight(string str, int totalWidth, char paddingChar = ' ')
Parameters
Type | Name | Description |
---|---|---|
string | str | The string to pad the end with |
int | totalWidth | The total length of the returned string |
char | paddingChar | The character to repeatedly pad the end of the string with until it is equal to the
|
Returns
Type | Description |
---|---|
string | A new string that has a total length of |
Power(double, double)
Returns a specified number raised to the specified power
Declaration
[FormulaFunction(Name = "Power", Type = "Mathematical Operator", Description = "Returns a number to the power of another.", Params = "1. The base number.\r\n2. The number to be raised as a power of the first.", ParamCount = 1)]
public double Power(double v, double e)
Parameters
Type | Name | Description |
---|---|---|
double | v | The number to raise to the specified power |
double | e | The power to raise the specified number |
Returns
Type | Description |
---|---|
double | A number raised to the specified power |
Random(int, int)
Returns a value that is randomly chosen to be greater than or equal to minValue
and less than
or equal to maxValue
Declaration
[FormulaFunction(Name = "Random", Type = "Mathematical Operator", Description = "Returns a random number between Min and Max.", Params = "1. The minimum value for the random number.\r\n2. The maximum value for the random number.", ParamCount = 2)]
public int Random(int minValue, int maxValue)
Parameters
Type | Name | Description |
---|---|---|
int | minValue | The minimum value the randomly generated number can be |
int | maxValue | The maximum value the randomly generated number can be |
Returns
Type | Description |
---|---|
int | A random number greater than or equal to |
Replace(string, string, string)
Returns a new string in which all occurances of search
are replaced with
repl
Declaration
[FormulaFunction(Name = "Replace", Type = "String", Description = "Replaces occurances of a specified string with a new string.", Params = "1. The string to search for occurances to replace.\r\n2. The string to search for in order to replace.\r\n3. The string to replace any found occurances with.", ParamCount = 3)]
public string Replace(string s, string search, string repl)
Parameters
Type | Name | Description |
---|---|---|
string | s | The string to create a new string from with any instances of the specified |
string | search | The string to search for and replace with |
string | repl | The string to replace all instances of |
Returns
Type | Description |
---|---|
string | A new string from |
Round(object)
Converts the specified value to a double representation
Declaration
[FormulaFunction(Name = "Round", Type = "Mathematical Operator", Description = "Rounds the specified number to 0 decimal places, using Bankers rounding.", Params = "1. The number to round.", ParamCount = 1)]
public double Round(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value | The value to return in double form |
Returns
Type | Description |
---|---|
double | A double representation of the supplied |
Round(object, int)
Rounds the specified number to the specified number of fractional units
Declaration
[FormulaFunction(Name = "Round", Type = "Mathematical Operator", Description = "Rounds the specified number to specified decimal places, using Bankers rounding.", Params = "1. The number to round.\r\n2. The amount of decimal places.", ParamCount = 2)]
public double Round(object value, int decimalPlaces)
Parameters
Type | Name | Description |
---|---|---|
object | value | The number to be rounded |
int | decimalPlaces | The number of decimal places to round to |
Returns
Type | Description |
---|---|
double | A new number rounded to the specified number of decimal places |
SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
Compares objCompare
to the result of the compareValue functions. If the object is equal then it
return the result of the corrosponding trueValue function. If there are no matches then the result of the
elseValue
function is returned
Declaration
[FormulaFunction(Name = "SelectCase", Type = "Other", Description = "Compares a specified value to another value, if it is the same it returns the corrosponding values return statement, otherwise returns the default statement.", Params = "1. The value to compare.\r\n2. The first possible value.\r\n3. The value to return if param 2 matches param 1.\r\n4. The value to return if no matches are found. Params 2 and 3 can be repeated multiple times (with different values) before this 'else' parameter.", ParamCount = 4, IsAsync = true)]
public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> elseValue)
Parameters
Type | Name | Description |
---|---|---|
object | objCompare | The object to compare against the compare functions |
Func<Task<object>> | compare1 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue1 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | elseValue | If no matches are found at all then this function is evaluated and returned |
Returns
Type | Description |
---|---|
Task<object> | The result of a trueValue function if a corrosponding compare function matches |
Remarks
Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.
SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
Compares objCompare
to the result of the compareValue functions. If the object is equal then it
return the result of the corrosponding trueValue function. If there are no matches then the result of the
elseValue
function is returned
Declaration
public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> elseValue)
Parameters
Type | Name | Description |
---|---|---|
object | objCompare | The object to compare against the compare functions |
Func<Task<object>> | compare1 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue1 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare2 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue2 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | elseValue | If no matches are found at all then this function is evaluated and returned |
Returns
Type | Description |
---|---|
Task<object> | The result of a trueValue function if a corrosponding compare function matches |
Remarks
Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.
SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
Compares objCompare
to the result of the compareValue functions. If the object is equal then it
return the result of the corrosponding trueValue function. If there are no matches then the result of the
elseValue
function is returned
Declaration
public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> elseValue)
Parameters
Type | Name | Description |
---|---|---|
object | objCompare | The object to compare against the compare functions |
Func<Task<object>> | compare1 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue1 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare2 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue2 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare3 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue3 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | elseValue | If no matches are found at all then this function is evaluated and returned |
Returns
Type | Description |
---|---|
Task<object> | The result of a trueValue function if a corrosponding compare function matches |
Remarks
Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.
SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
Compares objCompare
to the result of the compareValue functions. If the object is equal then it
return the result of the corrosponding trueValue function. If there are no matches then the result of the
elseValue
function is returned
Declaration
public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> elseValue)
Parameters
Type | Name | Description |
---|---|---|
object | objCompare | The object to compare against the compare functions |
Func<Task<object>> | compare1 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue1 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare2 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue2 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare3 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue3 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare4 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue4 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | elseValue | If no matches are found at all then this function is evaluated and returned |
Returns
Type | Description |
---|---|
Task<object> | The result of a trueValue function if a corrosponding compare function matches |
Remarks
Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.
SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
Compares objCompare
to the result of the compareValue functions. If the object is equal then it
return the result of the corrosponding trueValue function. If there are no matches then the result of the
elseValue
function is returned
Declaration
public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> compare5, Func<Task<object>> trueValue5, Func<Task<object>> elseValue)
Parameters
Type | Name | Description |
---|---|---|
object | objCompare | The object to compare against the compare functions |
Func<Task<object>> | compare1 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue1 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare2 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue2 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare3 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue3 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare4 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue4 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare5 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue5 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | elseValue | If no matches are found at all then this function is evaluated and returned |
Returns
Type | Description |
---|---|
Task<object> | The result of a trueValue function if a corrosponding compare function matches |
Remarks
Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.
SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
Compares objCompare
to the result of the compareValue functions. If the object is equal then it
return the result of the corrosponding trueValue function. If there are no matches then the result of the
elseValue
function is returned
Declaration
public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> compare5, Func<Task<object>> trueValue5, Func<Task<object>> compare6, Func<Task<object>> trueValue6, Func<Task<object>> elseValue)
Parameters
Type | Name | Description |
---|---|---|
object | objCompare | The object to compare against the compare functions |
Func<Task<object>> | compare1 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue1 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare2 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue2 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare3 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue3 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare4 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue4 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare5 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue5 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare6 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue6 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | elseValue | If no matches are found at all then this function is evaluated and returned |
Returns
Type | Description |
---|---|
Task<object> | The result of a trueValue function if a corrosponding compare function matches |
Remarks
Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.
SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
Compares objCompare
to the result of the compareValue functions. If the object is equal then it
return the result of the corrosponding trueValue function. If there are no matches then the result of the
elseValue
function is returned
Declaration
public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> compare5, Func<Task<object>> trueValue5, Func<Task<object>> compare6, Func<Task<object>> trueValue6, Func<Task<object>> compare7, Func<Task<object>> trueValue7, Func<Task<object>> elseValue)
Parameters
Type | Name | Description |
---|---|---|
object | objCompare | The object to compare against the compare functions |
Func<Task<object>> | compare1 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue1 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare2 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue2 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare3 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue3 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare4 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue4 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare5 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue5 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare6 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue6 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare7 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue7 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | elseValue | If no matches are found at all then this function is evaluated and returned |
Returns
Type | Description |
---|---|
Task<object> | The result of a trueValue function if a corrosponding compare function matches |
Remarks
Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.
SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
Compares objCompare
to the result of the compareValue functions. If the object is equal then it
return the result of the corrosponding trueValue function. If there are no matches then the result of the
elseValue
function is returned
Declaration
public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> compare5, Func<Task<object>> trueValue5, Func<Task<object>> compare6, Func<Task<object>> trueValue6, Func<Task<object>> compare7, Func<Task<object>> trueValue7, Func<Task<object>> compare8, Func<Task<object>> trueValue8, Func<Task<object>> elseValue)
Parameters
Type | Name | Description |
---|---|---|
object | objCompare | The object to compare against the compare functions |
Func<Task<object>> | compare1 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue1 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare2 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue2 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare3 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue3 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare4 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue4 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare5 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue5 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare6 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue6 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare7 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue7 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare8 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue8 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | elseValue | If no matches are found at all then this function is evaluated and returned |
Returns
Type | Description |
---|---|
Task<object> | The result of a trueValue function if a corrosponding compare function matches |
Remarks
Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.
SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
Compares objCompare
to the result of the compareValue functions. If the object is equal then it
return the result of the corrosponding trueValue function. If there are no matches then the result of the
elseValue
function is returned
Declaration
public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> compare5, Func<Task<object>> trueValue5, Func<Task<object>> compare6, Func<Task<object>> trueValue6, Func<Task<object>> compare7, Func<Task<object>> trueValue7, Func<Task<object>> compare8, Func<Task<object>> trueValue8, Func<Task<object>> compare9, Func<Task<object>> trueValue9, Func<Task<object>> elseValue)
Parameters
Type | Name | Description |
---|---|---|
object | objCompare | The object to compare against the compare functions |
Func<Task<object>> | compare1 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue1 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare2 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue2 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare3 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue3 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare4 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue4 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare5 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue5 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare6 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue6 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare7 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue7 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare8 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue8 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare9 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue9 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | elseValue | If no matches are found at all then this function is evaluated and returned |
Returns
Type | Description |
---|---|
Task<object> | The result of a trueValue function if a corrosponding compare function matches |
Remarks
Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.
SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
Compares objCompare
to the result of the compareValue functions. If the object is equal then it
return the result of the corrosponding trueValue function. If there are no matches then the result of the
elseValue
function is returned
Declaration
public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> compare5, Func<Task<object>> trueValue5, Func<Task<object>> compare6, Func<Task<object>> trueValue6, Func<Task<object>> compare7, Func<Task<object>> trueValue7, Func<Task<object>> compare8, Func<Task<object>> trueValue8, Func<Task<object>> compare9, Func<Task<object>> trueValue9, Func<Task<object>> compare10, Func<Task<object>> trueValue10, Func<Task<object>> elseValue)
Parameters
Type | Name | Description |
---|---|---|
object | objCompare | The object to compare against the compare functions |
Func<Task<object>> | compare1 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue1 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare2 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue2 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare3 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue3 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare4 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue4 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare5 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue5 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare6 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue6 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare7 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue7 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare8 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue8 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare9 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue9 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | compare10 | A function that returns a value for comparrison with |
Func<Task<object>> | trueValue10 | A function that holds the result to be returned when the corrosponding compare function
matches with |
Func<Task<object>> | elseValue | If no matches are found at all then this function is evaluated and returned |
Returns
Type | Description |
---|---|
Task<object> | The result of a trueValue function if a corrosponding compare function matches |
Remarks
Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.
Sin(double)
Returns the sine of the specified angle
Declaration
[FormulaFunction(Name = "Sin", Type = "Mathematical Operator", Description = "Performs a Sin mathematical operation.", Params = "1. Number to perform Sin operation on.", ParamCount = 1)]
public double Sin(double v)
Parameters
Type | Name | Description |
---|---|---|
double | v | The angle to return the sine of |
Returns
Type | Description |
---|---|
double | The sine of |
Sqrt(double)
Returns the square root of a specified number
Declaration
[FormulaFunction(Name = "Sqrt", Type = "Mathematical Operator", Description = "Returns the square root of the specified number.", Params = "1. The number to return the square root of.", ParamCount = 1)]
public double Sqrt(double v)
Parameters
Type | Name | Description |
---|---|---|
double | v | The number to return the square root of |
Returns
Type | Description |
---|---|
double | The square root of a given number |
Substr(string, int, int)
Returns a specified portion of the given string
Declaration
[FormulaFunction(Name = "Substr", Type = "String", Description = "Returns a specified portion of the specified string.", Params = "1. The string to return a portion of.\r\n2. The index of the first character within the string to start returning a tring from.\r\n3. The length of the string to return. If no parameter is passed, then the end of the string is assumed.", ParamCount = 3)]
public string Substr(string s, int from, int len = 2147483647)
Parameters
Type | Name | Description |
---|---|---|
string | s | The string to return a portion of |
int | from | The 0 based index in the string to start the return string from |
int | len | The length of the string to return starting from |
Returns
Type | Description |
---|---|
string | A new string that starts at position |
Today()
Returns the current date with a time set to 00:00:00
Declaration
[FormulaFunction(Name = "Today", Type = "Date", Description = "Returns todays date with the time component set to 00:00:00.", Params = "", ParamCount = 0)]
public DateTime Today()
Returns
Type | Description |
---|---|
DateTime | The current date with a time set to 00:00:00 |
TodayString()
Returns the current date in international date format - Year-Month-Day
Declaration
[FormulaFunction(Name = "TodayString", Type = "Date", Description = "Returns todays date with the time component set to 00:00:00.", Params = "", ParamCount = 0)]
public string TodayString()
Returns
Type | Description |
---|---|
string | The current date in international date format - Year-Month-Day |
Trim(string)
Removes all leading and trailing white space characters from str
Declaration
[FormulaFunction(Name = "Trim", Type = "String", Description = "Trims the supplied string, removing trailing and leading spaces.", Params = "1. The string to trim.", ParamCount = 1)]
public string Trim(string str)
Parameters
Type | Name | Description |
---|---|---|
string | str | The string to trim |
Returns
Type | Description |
---|---|
string |
|
TrimEnd(string, char[])
Removes all occurances of the trimChars
set of characters that are trailing characters from
str
Declaration
[FormulaFunction(Name = "TrimEnd", Type = "String", Description = "Removes all trailing occurances of a specified set of characters from the specified string.", Params = "1. The string to trim.\r\n2. The string occurance to remove.", ParamCount = 2)]
public string TrimEnd(string str, char[] trimChars)
Parameters
Type | Name | Description |
---|---|---|
string | str | The string to trim |
char[] | trimChars | The set of characters to remove as trailing characters |
Returns
Type | Description |
---|---|
string |
|
TrimStart(string, char[])
Removes all occurances of the trimChars
set of characters that are leading characters from
str
Declaration
[FormulaFunction(Name = "TrimStart", Type = "String", Description = "Removes all leading occurances of a specified set of characters from the specified string.", Params = "1. The string to trim.\r\n2. The string occurance to remove.", ParamCount = 2)]
public string TrimStart(string str, char[] trimChars)
Parameters
Type | Name | Description |
---|---|---|
string | str | The string to trim |
char[] | trimChars | The set of characters to remove as leading characters |
Returns
Type | Description |
---|---|
string |
|
Trunc(double, int)
Truncates the specified number to a given prec
precision
Declaration
[FormulaFunction(Name = "Trunc", Type = "Mathematical Operator", Description = "Truncates the specified number to a given precision.", Params = "1. The number to truncate.\r\n2. The precision to truncate by, if nothing then 0 is assumed.", ParamCount = 2)]
public double Trunc(double value, int prec = 0)
Parameters
Type | Name | Description |
---|---|---|
double | value | The value to truncate |
int | prec | The rpecision to truncate the value to |
Returns
Type | Description |
---|---|
double | A new double with the given value with the specified precision |
Upper(string)
Returns a given string in all uppercase
Declaration
[FormulaFunction(Name = "Upper", Type = "String", Description = "Returns the specified string in upper case.", Params = "1. The string to return in upper case.", ParamCount = 1)]
public string Upper(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | The string to be converted to all uppercase |
Returns
Type | Description |
---|---|
string | A uppercase version of the |
ValBool(object)
Returns the value converted to a boolean representation
Declaration
[FormulaFunction(Name = "ValBool", Type = "Conversion", Description = "Returns the specified value formatted as a boolean (True|False).", Params = "1. The value to be formatted as a boolean.", ParamCount = 1)]
public bool ValBool(object v)
Parameters
Type | Name | Description |
---|---|---|
object | v | The value to convert to a boolean |
Returns
Type | Description |
---|---|
bool | A boolean representation of the supplied value |
ValDate(object)
Returns the value converted to a datetime representation
Declaration
[FormulaFunction(Name = "ValDate", Type = "Conversion", Description = "Returns the specified value formatted as a date time.", Params = "1. The value to be formatted as a date.", ParamCount = 1)]
public DateTime ValDate(object v)
Parameters
Type | Name | Description |
---|---|---|
object | v | The value to convert to a datetime |
Returns
Type | Description |
---|---|
DateTime | A datetime representation of the supplied value |
ValDateTimeOffset(object)
Returns the value converted to a datetime representation
Declaration
[FormulaFunction(Name = "ValDateTimeOffset", Type = "Conversion", Description = "Returns the specified value formatted as a date time offset.", Params = "1. The value to be formatted as a date.", ParamCount = 1)]
public DateTimeOffset ValDateTimeOffset(object v)
Parameters
Type | Name | Description |
---|---|---|
object | v | The value to convert to a datetime offset |
Returns
Type | Description |
---|---|
DateTimeOffset | A datetime representation of the supplied value |
ValDecimal(object)
Returns the value converted to a decimal representation
Declaration
[FormulaFunction(Name = "ValDecimal", Type = "Conversion", Description = "Returns the specified value formatted as a decimal.", Params = "1. The value to be formatted as a decimal.", ParamCount = 1)]
public decimal ValDecimal(object v)
Parameters
Type | Name | Description |
---|---|---|
object | v | The value to convert to a decimal |
Returns
Type | Description |
---|---|
decimal | A decimal representation of the supplied value |
ValID(object)
Returns the value converted to a guid representation
Declaration
[FormulaFunction(Name = "ValID", Type = "Conversion", Description = "Returns the specified value formatted as an id value.", Params = "1. The value to be formatted as an id.", ParamCount = 1)]
public Guid ValID(object v)
Parameters
Type | Name | Description |
---|---|---|
object | v | The value to convert to a guid |
Returns
Type | Description |
---|---|
Guid | A guid representation of the supplied value |
ValLong(object)
Returns the value converted to a long representation
Declaration
[FormulaFunction(Name = "ValLong", Type = "Conversion", Description = "Returns the specified value formatted as a long value.", Params = "1. The value to be formatted as a long.", ParamCount = 1)]
public long ValLong(object v)
Parameters
Type | Name | Description |
---|---|---|
object | v | The value to convert to a long |
Returns
Type | Description |
---|---|
long | A long representation of the supplied value |
ValString(object)
Returns the specified value formatted as a string
Declaration
[FormulaFunction(Name = "ValString", Type = "Conversion", Description = "Returns the specified value formatted as a string.", Params = "1. The value to be formatted as a string.", ParamCount = 1)]
public string ValString(object v)
Parameters
Type | Name | Description |
---|---|---|
object | v | The value to return as a string |
Returns
Type | Description |
---|---|
string | A string representation of the supplied value |
WCase(string)
Returns a given string with a capitalized first letter, followed by all lowercase letters
Declaration
[FormulaFunction(Name = "WCase", Type = "String", Description = "Returns the specified string in with a capitalised first letter, followed by all lower case letters.", Params = "1. The string to return with a capitalised first letter, followed by all lower case letters.", ParamCount = 1)]
public string WCase(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | The string to be converted to an initial uppercase and followed by all lowercase letters |
Returns
Type | Description |
---|---|
string | A version of the |
WeekDay(DateTime)
Returns the day of the week from the value of a given date
Declaration
[FormulaFunction(Name = "WeekDay", Type = "Date", Description = "Retrieves the day of the week from the specified date.", Params = "1. The date value.", ParamCount = 1)]
public int WeekDay(DateTime d)
Parameters
Type | Name | Description |
---|---|---|
DateTime | d | The date to get the day of the week value of |
Returns
Type | Description |
---|---|
int | The day of the week for a given date |
Year(DateTime)
Returns the year value of a given date
Declaration
[FormulaFunction(Name = "Year", Type = "Date", Description = "Retrieves the year of the specified date.", Params = "1. The date value.", ParamCount = 1)]
public int Year(DateTime d)
Parameters
Type | Name | Description |
---|---|---|
DateTime | d | The date to get the year value of |
Returns
Type | Description |
---|---|
int | The year of a given date |
YearDifference(DateTime, DateTime)
Returns the number of years between two dates
Declaration
[FormulaFunction(Name = "YearDifference", Type = "Date", Description = "Returns the number of years between two dates.", Params = "1. The date to subtract the next date from.\r\n2. The 2nd date.", ParamCount = 2)]
public decimal YearDifference(DateTime date1, DateTime date2)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date1 | The first date to find the number of years difference with |
DateTime | date2 | The second date to find the numbers of years difference with |
Returns
Type | Description |
---|---|
decimal | The number of years between |