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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Multiplying an attribute by another attribute

There must be something I'm just missing entirely. I'm trying to multiply two attributes together into an autocalc, but it just ignores the second attribute. Weirdly, it works fine if I add them together, just not multiplication.
1565461995
GiGs
Pro
Sheet Author
API Scripter
What does your autocalc value look like?
It ignores the second attribute, so it just mirrors the first. For instance if attribute one is 5, and attribute two is 6, the autocalc value will just be 5.
1565463336
Andreas J.
Forum Champion
Sheet Author
Translator
Could you copypaste the autocalc formula you're using so we see exactly how it looks like? An explanation of the situation is good, but seeing the actual thing is always better.
<input type="number" style="width:50px" name="attr_power1tcost" value="@{power1bcost}*@{power1dice}" disabled="true" />
1565464756
GiGs
Pro
Sheet Author
API Scripter
are power1bcost and powerbdice numbers? what do their values look like? try putting them in [[ ]]. one of these:  value="@{power1bcost}*[[@{power1dice}]]"  value="[[@{power1bcost}]]*@{power1dice}"  value="[[@{power1bcost}]]*[[@{power1dice}]]"  value="[[@{power1bcost}*@{power1dice}]]"
Power1bcost is also an autocalc of other attributes added together. Powerbdice is a user inputted number. I'll try those.
I figured out the issue, I forgot to put parenthesis around the power1bcost autocalc, so the second autocalc wasn't treating that attribute as all one number, so there was nothing to multiply the second attribute by unless I filled in the last attribute added to the first autocalc. 
1565466046
GiGs
Pro
Sheet Author
API Scripter
that makes sense, glad you got it sorted.