Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - RPG chr sheet (pdf)
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

RPG chr sheet (pdf)

 Post Reply Post Reply
Author
magnusprime27 View Drop Down
New Member
New Member


Joined: 01 Jul 2018
Location: us
Points: 2
Post Options Post Options   Quote magnusprime27 Quote  Post ReplyReply Direct Link To This Post Topic: RPG chr sheet (pdf)
    Posted: 01 Jul 2018 at 8:14pm
im trying to calculate half lv rounded down..
specifilly this is fo starfinder and resovle points..
resolve points is calculated as half your level + your key ability mod
 
so for the sheet I have a "LV" input box
this determines stamina points and health points per level as well..
 
so far the box that does the calculation shows the value when its a even half.....
Example: lv 4 is 2, lv6 is 3 etc..
but when lets say lv 3...I get 1.5
and at lv 1  is 1 (min1)
what I don't know how to do is to get it to round down to just 1
 
heres my code...
 
var f = this.getField("LV");
g = f.value;
h = g / 2;
if (h < 1) { h = 1 };
event.value = h ;
 
help would be appreciated...
ive seen bits about using math.floor but not sure how or where to pit it?

 
Back to Top
Sponsored Links


Back to Top
try67 View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Points: 622
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 08 Jul 2018 at 11:47am
Use this:

var f = this.getField("LV");
g = f.value;
h = g / 2;
event.value = Math.floor(h);
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com
Back to Top
magnusprime27 View Drop Down
New Member
New Member


Joined: 01 Jul 2018
Location: us
Points: 2
Post Options Post Options   Quote magnusprime27 Quote  Post ReplyReply Direct Link To This Post Posted: 09 Jul 2018 at 4:36am
This is how I got it to work...
 
var f = this.getField("LV");
g = f.value;
h = ((g - (g % 2))) / 2;
if (h < 2) { h = 1 };
if (h > 0) { h = + h };
event.value = h ;
 
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.031 seconds.