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
This post has been closed. You can still view previous posts, but you can't post any new replies.

Flooring a Variable

How can I fix this macro to make the floor function work properly? [[((?{MR}/10)+1)d6]] I want whatever I input as MR to be divided by 10, and 1 added to the result. I want that amount to be rounded down and the result to be a number of d6s rolled. For example, if I input the number 37, I want it to perform the following: (37/10)+1 = 4.7, rounded down to 4 and then roll 4d6. The problem is, whenever I put in the floor command, it ignores the d6 entirely and the above example would just result in a static 4. I have tried grouping things with brackets in every permutation I can think of, but I can't seem to get it to work.
1462834971

Edited 1462835230
Rounding functions need to be nested within an additional pair of inline roll brackets in order to be used in conjunction with dice. e.g. [[ ([[floor(?{MR} / 10)]] + 1)d6 ]] or [[ [[floor(?{MR} / 10) + 1]]d6 ]]
Thanks a bunch! That one was really driving me crazy.
1462835894

Edited 1462835933
You're very welcome! Yes, the Order of Operations does provide us with little stumbling blocks to challenge us. :) I'll close this thread, but please feel welcome to open a new one if you have another Specific Use Question!