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

[Newbie] problem with divide values

1558442852

Edited 1558443371
Hi ! first of all, i think it's a simple problem for you but I did not find the solution by searching on roll20. Maybe i'm a newbie too to find a tips ^^' So this is my problem :   i want to implement this calculation : floor(@{Agility]-5/2)+floor(@[Agility]-5/10)+1  But when I tried, I had a bad result. So I decided to split the calculation and I find this : <input type="number" name="attr_Agility" value="5" /> ==> Agility : 5 <input type="number" name="attr_Agmod" value="@{Agility}-5" disabled="true" /> ==> Default : 0 <input type="number" name="attr_Agfloory" value="floor(@{Agmod}/2)" disabled="true" /> ==> Default : obtain 2 <input type="number" name="attr_Agfloorz" value="floor(@{Agmod}/10)" disabled="true" /> ==> Default : obtain 4 <input type="number" name="attr_Agility_mod" value="@{Agfloorz}+@{Agfloory}+1" disabled="true" /> ==> So, in deed, i obtain 7 Someone can explain where where I was wrong ?
It looks like you have some syntax errors where you have square bracket where squiggly one should be.  Also the way you have the computation in the inputs you should have the formula, floor(@{Agility}/2-5/2)+floor(@{Agility}/10-5/10)+1 
1558509793

Edited 1558509807
The problem doesn't changed when you split the calculation. =/
I don't know.  It's working for me.  I tested the floor function with random attributes from 5E OGL and all works as intended.  
1558512285
GiGs
Pro
Sheet Author
API Scripter
Ania, can you paste the code for the input you are using?
1558515996

Edited 1558516442
Finally, i have found a another way. floor(@{Agility}*0.596-2.525) It's works and it's no complex. Thanks for your help ^^