Merge pull request #661 from anant-j/dev

Add Mod operation
This commit is contained in:
Svilen Markov
2025-05-16 17:33:58 +01:00
committed by GitHub
2 changed files with 13 additions and 1 deletions

View File

@ -238,7 +238,7 @@ Output:
<div>90</div>
```
Other operations include `add`, `mul`, and `div`.
Other operations include `add`, `mul`, `div` and `mod`.
<hr>
@ -431,6 +431,7 @@ The following helper functions provided by Glance are available:
- `sub(a, b float) float`: Subtracts two numbers.
- `mul(a, b float) float`: Multiplies two numbers.
- `div(a, b float) float`: Divides two numbers.
- `mod(a, b int) int`: Remainder after dividing a by b (a % b).
- `formatApproxNumber(n int) string`: Formats a number to be more human-readable, e.g. 1000 -> 1k.
- `formatNumber(n float|int) string`: Formats a number with commas, e.g. 1000 -> 1,000.
- `trimPrefix(prefix string, str string) string`: Trims the prefix from a string.