You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+71-5Lines changed: 71 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -51,20 +51,86 @@ Complex calculation:
51
51
52
52
## Available operators
53
53
54
+
### Type conversion
55
+
56
+
Operator | Description
57
+
--- | ---
58
+
`INT(a)` | convert to integer
59
+
`FLOAT(a)` | convert to float
60
+
`STRING(a)` | convert to string
61
+
62
+
### Format
63
+
64
+
Operator | Description
65
+
--- | ---
66
+
`SLUG(a)` | transform string to slug (e.g. "This is a title" → "this-is-a-title")
67
+
`CURRENCY(a)` | format number to currency (e.g. 3000 → "3,000")
68
+
69
+
### Date
70
+
54
71
Operator | Description
55
72
--- | ---
73
+
`DATE_ISO(a)` | transform date or date-like object to ISO string
74
+
`DATE_UTC(a)` | transform date or date-like object to UTC string
75
+
76
+
### Arithmetic
77
+
78
+
Operator | Description
79
+
--- | ---
80
+
`ABS(a)` | absolute
81
+
`SQRT(a)` | square root
82
+
`SUM(a)` | sum an array of numbers
56
83
`SUM(a, b)` | a + b
84
+
`AVERAGE(a)` | average value of an array of number
57
85
`SUBTRACT(a, b)` | a - b
58
86
`MULTIPLY(a, b)` | a * b
59
87
`DIVIDE(a, b)` | a / b
60
88
`REMAINDER(a, b)` | a % b
61
89
`ROUND(a, n)` | round number `a` to `n` number of decimals, similar to `toFixed`
90
+
`MAX(a, b)` | max value
91
+
`MIN(a, b)` | min value
92
+
`POWER(a, b)` | a^b
93
+
94
+
### String
95
+
96
+
Operator | Description
97
+
--- | ---
98
+
`STR_LEN(a)` | length of string
99
+
`LOWER(a)` | to lower case
100
+
`UPPER(a)` | to upper case
101
+
`TRIM(a)` | removes whitespace at the beginning and end of string.
62
102
`CONCAT(a, b)` | concat 2 strings
63
-
`INT(a)` | convert to integer
64
-
`FLOAT(a)` | convert to float
65
-
`STRING(a)` | convert to string
66
-
`SLUG(a)` | transform a string to a slug (e.g. "This is a title" → "this-is-a-title")
67
-
`CURRENCY(a)` | format number a to currency (e.g. 3000 → "3,000")
103
+
`LEFT(a, b)` | extract `b` characters from the beginning of the string.
104
+
`RIGHT(a, b)` | extract `b` characters from the end of the string.
105
+
106
+
### Boolean
107
+
108
+
Operator | Description
109
+
--- | ---
110
+
`NULL(a)` | check is null
111
+
`NOT_NULL(a)` | check is not null
112
+
`NOT(a)` | logical NOT
113
+
`EQUAL(a, b)` | a = b
114
+
`NOT_EQUAL(a, b)` | a <> b
115
+
`GT(a, b)` | a > b
116
+
`GTE(a, b)` | a >= b
117
+
`LT(a, b)` | a < b
118
+
`LTE(a, b)` | a <= b
119
+
`AND(a, b)` | logical AND
120
+
`OR(a, b)` | logical OR
121
+
122
+
### Array
123
+
124
+
Operator | Description
125
+
--- | ---
126
+
`ARRAY_LEN(a)` | length of array
127
+
128
+
### Relational
129
+
130
+
Operator | Description
131
+
--- | ---
132
+
`ASUM(a, b)` | Aggregated sum of O2M field. For example: calculate shopping cart total price with `ASUM(products, MULTIPLY(price, quantity))` where `products` is the O2M field in the shopping cart and `price` & `quantity` are 2 fields of `products`.
0 commit comments