The following quick reference table summarizes the numeric, string, date, time and datetime functions covered in the previous topics.
For details and examples of how to use the Python functions, see:
BRAINscript | Python |
---|---|
abs() |
|
ceil() |
math.ceil(x) |
double() |
float() |
floor() |
math.floor(x) |
int() |
int(x) |
isNumber() |
Custom function |
long() |
long() |
round() |
round(x) |
pow() square() |
math.pow() |
sqrt() |
math.sqrt() |
left() |
x[:num] |
ltrim() |
lstrip(x) |
isSpace() |
isspace() |
pad() |
{}.format(x) |
replace() |
x.replace() |
right() |
x[num:] |
rtrim() |
rstrip(x) |
split() |
x.split('char') |
strFind() |
x.find('char') |
strlen() |
len(x) |
substr() |
x[n:m] |
toLower() |
x.lower() |
toUpper() |
x.upper() |
trim() |
x.strip() |
date() dateSubtract() |
|
dateAdjust() timeSubtract() dateTimeAdjust() |
datetime.timedelta() |
day() month() year() |
|
time() |
datetime.time() |
hours() minutes() seconds() |
|
timestamp() |
datetime.datetime() |