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

Rounding

Okay, this seems like such a simple thing, but for the life of me I can't get it to work. I am trying to round something up using the function "ceiling()" but it doesn't work and I don't know why. Here is the formula. [[@{selected|casterlevel}+(ceiling(((1d20+@{selected|cha-mod})/3))-4)]]. If I render it without the ceiling function "[[@{selected|casterlevel}+(((1d20+@{selected|cha-mod})/3)-4)]]" it rolls, but without the rounding effect. When I try to add the rounding effect it simply cancels everything out and renders just the caster level. Could you help me solve this problem?
Try: [[ @{selected|casterlevel} + ceil ((1d20 + @{selected|cha-mod}) / 3) - 4 ]]
Thanks for the help. I tried your formula and it worked. However, it seemed an awful lot like mine and so it bugged me that mine didn't. After doing a bit of experimenting I found the problem, and I feel rather silly. I was trying to round by putting in ceiling, but it doesn't work with the 'ing.' If I had used simply 'ceil' it would have worked. Again, thank you for the help. I don't think I would have figured that out with your help.
You're welcome. Such mistakes are very common, and I've fallen victim to them more times than I can count!