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

Macros: How to remove decimal from Macro result

Hi,

I'm new at roll20 and just started leanring how to use macros.
I'm tryng to remove a decimal results that sometimes occur from a macro I run.


For example, [[(10D6)*1.5]] Sometime this results in a number like 72.5, 64.5,
How would I remove the point 5, roundng down.


Thanks,

Daryl
.


May 13 (11 years ago)
Pat S.
Forum Champion
Sheet Author
In the Wiki there is a rounding rolls section.
Thanks a lot!
Greatly appreciated.

May 13 (11 years ago)
Pat S.
Forum Champion
Sheet Author
You're welcomed and above and below that section is other sections about the die roller and how to use them in macros.
Could this be used with an Inline macro?
I tried and I can't seem to get it to work.

Thanks,

Daryl
[[ floor( ( 10D6 )*1.5 ) ]] should do it; haven't tested though.

PS: Don't be afraid to space things out if it makes it easier to view.
May 13 (11 years ago)
Pat S.
Forum Champion
Sheet Author
[[floor(?{number to be round|0}/2) + 2d6]]

That will allow you to enter any number to be rounded down along with it being added to 2d6. You can change the 2d6 to any dice you want for the roll.
Thanks Again!!
May 15 (11 years ago)
Pat S.
Forum Champion
Sheet Author
Glad it helped