Mark said: Brian said: Mark said: Simon S. said: Here's a little modulo trick that works for positive integers of any size: [[ ((@{X}+2) % (@{X}+1)) ]] How about the reverse? (Return 0 if it's above 0, return 1 if it's 0) If you have a formula that produces 0 in one case and 1 in all other cases, you can flip that result by subtracting your formula from 1. 1 - 0 produces 1, and 1 - 1 produces 0. The above part is key. I have 0, 2, 6, 3.5, etc. I'm just optimizing a formula at this point though. Aaron's reverse is decent, but it doesn't shorten my original formula. I was hoping to find a short version like Simon posted. I count three solutions in this thread which will result in 0 for X=0 and 1 for X>0. In all of those cases, (1 - @{solution}) will produce 1 for X=0 and 0 for X>0. Travis M. said: Works fine in math-only rolls, and when doing things like [[1d20+@{y}]] (which is what I was using it for), but it doesn't seem to work for things like [[(@{y})d6]]. I'll keep the ones you guys gave me saved for when I inevitably need to do a roll like that, though. Will come in handy when/if I get around to making a sheet that's also a fully automated character builder... You cannot use any functions for calculating the number of dice, unfortunately. Simon's solution ought to work, though.