Numeric and Text Processor

This usefull set of methods you can use with calc api request.

For example: @calc %Result=round(%sum,2)


Generate a random integer. If called without the optional min, max arguments rand() returns a pseudo-random integer between 0 and getrandmax(). If you want a random number between 5 and 15 (inclusive).

For example: rand(5, 15)


Returns the rounded value of val to specified precision (number of digits after the decimal point). Precision can also be negative or zero (default).

Example: round(12.25, 1)


This function returns a string or an array with all occurrences of search in subject replaced with the given replace value. Count — If passed, this will be set to the number of replacements performed.

For example: str_replace('no','yes','I always say no')


Get string length


Performs case folding on a %String, converted in the way specified by mode.

Mode — The mode of the conversion. It can be one of:

  • 0 — Upper case
  • 1 — Lower case
  • 2 — Camel case


Find position of last occurrence of a search string in a string. This can be useful, when you need to check, is string contains some keywords. If result is '0', keyword not contains in provided string

Example: mb_strpos('Where i can buy tickets?','ticket')