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 up and or down in macro

As it states! Is there a way to round numbers up or down, for example trapfinding for a rogue. Say its level 5 it takes half the rogue level and adds it to disable device and stuff, Thatd be 2.5. Is there a neat and nice way inside of the macro to round it up or down so it comes out as a whole number or is that too difficult at this point in time.
floor or ceiling floor( ceil( There is no round, I dont think
Rounding Rolls You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: floor() , which will always round the number down (e.g. 5.7 becomes 5), and ceil() which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:
1409299230
Lithl
Pro
Sheet Author
API Scripter
There is also a round() function in addition to floor and ceil. Also note that if you have a calculation for the number of dice to roll, round will be applied automatically (since you con't roll fractional dice). Also also, floor(x + 0.5) and ceil(x - 0.5) behave identically to round(x) .
using the round() function, does that round up or down or does it round like .4 and under rounds down, and .5 and up rounds up?
nevermind figured it out, thanks everyone!