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
You can also calculate inside display text with the math placeholder:
312
+
313
+
```text
314
+
{math_1+1}
315
+
{math_ROUND(10/3, 2)}
316
+
{math_SIGMA(1, 10, "i")}
317
+
```
318
+
319
+
### Custom Function: SIGMA
320
+
321
+
UltimateShop adds one custom math function:
322
+
323
+
```text
324
+
SIGMA(start, end, "body")
325
+
```
326
+
327
+
`SIGMA`loops from `start` to `end` inclusively. The current loop value is
328
+
available as `i` inside the quoted `body` expression.
329
+
330
+
```text
331
+
SIGMA(1, 10, "i")
332
+
SIGMA(1, 10, "i * i")
333
+
SIGMA(1, 5, "i ^ 3")
334
+
SIGMA(1, 4, "FACT(i)")
335
+
SIGMA(1, 10, "IF(i % 2 == 0, i, 0)")
336
+
SIGMA(1, 5, "E ^ (-0.1 * i)")
337
+
```
338
+
339
+
Examples:
340
+
341
+
```text
342
+
SIGMA(1, 10, "i") = 55
343
+
SIGMA(1, 10, "i * i") = 385
344
+
SIGMA(1, 5, "i ^ 3") = 225
345
+
SIGMA(5, 1, "i") = 0
346
+
```
347
+
348
+
For YAML, wrap the whole expression in single quotes when the `SIGMA` body uses
349
+
double quotes:
350
+
351
+
```yaml
352
+
amount: 'SIGMA(1, 10, "i * i")'
353
+
```
354
+
355
+
`SIGMA`is limited to 100000 iterations per call to protect server performance.
356
+
357
+
---
358
+
133
359
## ⚙️ Actions and Conditions
134
360
135
361
UltimateShop allows actions and conditions to be triggered by:
@@ -171,4 +397,4 @@ UltimateShop allows actions and conditions to be triggered by:
171
397
172
398
Consider respect my work and buy the plugin here, you can get free support, subbmit suggestion service. [Click to buy](https://www.spigotmc.org/resources/ultimateshop-premium-menu-dynamic-price-limits-apply-settings-sell-all-and-more-1-17-1-20.113069/)
173
399
174
-
You can also get free version here. [Click to download](https://www.spigotmc.org/resources/ultimateshop-menus-limits-apply-settings-10-directly-hook-and-more-1-17-1-20.110601/)
400
+
You can also get free version here. [Click to download](https://www.spigotmc.org/resources/ultimateshop-menus-limits-apply-settings-10-directly-hook-and-more-1-17-1-20.110601/)
0 commit comments