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

Minimum or Maximum for calculations

1652572121

Edited 1652572161
Pardon if this has already been covered, but I'm just learning some of this, and I could not find it in the forums.  I'm attempting a calculation in a macro, but I do not want it to return negative numbers. Or, rather for it to have a minimum, such as zero. So basically if it is WISDOM minus 15, a wisdom of 18 would return as 3, but I want a wisdom of less than 15 to return as zero.   [[@{selected|wisdom}-15]] works fine, but if the Wisdom score is less than 15, it returns a negative number obviously.  Is there a way to have a minimum (or maximum) cap to the numbers in a macro without going to API scripts? I am a pro user, but I am not a coder and do not really understand API scripts yet.  Thanks for the help. 
1652574799
vÍnce
Pro
Sheet Author
Hi Harvey, you can use grouping rolls to set limits. Try, [[ {@{selected|wisdom}-15, 0}kh1 ]]
vÍnce said: Hi Harvey, you can use grouping rolls to set limits. Try, [[ {@{selected|wisdom}-15, 0}kh1 ]] Worked perfectly!! And was able to embed that into another calculation. Thanks a lot.