Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add max and min to expressions #1249

Merged
merged 1 commit into from
Oct 9, 2023
Merged

Add max and min to expressions #1249

merged 1 commit into from
Oct 9, 2023

Conversation

cswhite2000
Copy link
Member

Adds max and min as functions that can be used in <set/> actions

Example:

<set var="player_score" value="min(player_score,3)"/>
or
<set var="player_score" value="max(player_score,10)"/>

Signed-off-by: Christopher White <[email protected]>
@Pablete1234
Copy link
Member

Just to leave a record of it, we discussed trying to support things like max(a, b, c, d) but Exp4j expects a specific number of parameters for a function, no support for variable amount of args.

Would be great to long-term have that tho, but for the time being 2-arg is the best we can do

@Pablete1234 Pablete1234 added the ready PR is ready to merge label Oct 8, 2023
@Electroid Electroid merged commit 3641ab0 into dev Oct 9, 2023
2 checks passed
@Electroid Electroid deleted the maxmin branch October 9, 2023 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready PR is ready to merge
Development

Successfully merging this pull request may close these issues.

3 participants