Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Macro help, need to keep highest of two calculations

Hello. After multiple attempts and numerous searches, I'm stuck. I want my macro to calculate two values and only keep the largest value (or drop the lowest). something like "calculate STR / 10 rounded up, compare to DEX / 10 rounded up, keep the larger result" [[ceil(@{selected|STR}/10)ceil(@{selected|DEX}/10)k1]]  If this is possible, I think whatever is the operator or punctuation between the two values is where I am stuck. Math operators actually do the math, commas and spaces don't seem to help. 
1643034663
timmaugh
Forum Champion
API Scripter
You're close. You need a comma between the values you're going to compare for the keep-high or keep-low, and you need to enclose the batch in braces... something like: [[{ceil(@{selected|STR}/10),ceil(@{selected|DEX}/10)}k1]] 
Boom, that seems to be the answer! Thanks so much! (In all my experiments I was missing the { } around the whole comparison.)