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

Calculating Negative Numbers

I have an Attribute @{DCV} that cannot be reduced below zero in the game system used (6e HERO System).  Is there a non-API way to write a macro that will subtract a number from the Attribute but will output '0' if the result is a negative number?   For example... Attribute DCV = 3 /emas @{selected|token_name} is currently DCV [[@{DCV}-5]]! Is it possible to write the macro so that the result is displayed at '0' rather than '-2'?
1464012624

Edited 1464012644
Yup; you can use a  Keep / Drop function to keep the higher 1 between @{DCV} - 5 and 0.
1464023804
Lithl
Pro
Sheet Author
API Scripter
To specifically show what Silvyre is talking about, try this: /emas @{selected|token_name} is currently DCV [[{@{selected|DCV}-5,0}kh1]]
Thanks guys! :)