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

[Help] Character sheet not subtracting a negative number.

1452461021

Edited 1452461165
I have the following code: <td><input type="number" name="attr_snaps_target_total" value="@{wpn_accr_tar} - @{snaps_mod} - @{shoottier}" disabled="true"></td> <td><input type="number" name="attr_snaps_mod" title="@{repeating_weapon_X_snaps_mod}" style="width: 80px;" value='-1'></td> Basically the second value (@snaps_mod) is negative and is subtracted from the value of the first one. This is part of a repeating set of weapons. If I modify the value from -1 to 0 it works. If I edit the number on the character sheet down to -1, then the output for the first value goes blank.
The sheets do not like subtracting a negative.  Its that whole double negative, divide by zero sort of thing.  Instead, add the negative.  (4) + (-2) = 2.  If the input number is negative, it will be subtracted from the total. <td><input type="number" name="attr_snaps_target_total" value="@{wpn_accr_tar} + @{snaps_mod} + @{shoottier}" disabled="true"></td> <td><input type="number" name="attr_snaps_mod" title="@{repeating_weapon_X_snaps_mod}" style="width: 80px;" value='-1'></td>