Print Page | Close Window

RPG chr sheet (pdf)

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: Beginners
Forum Description: This is for users new to PDF. Ask simple questions here.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=3991
Printed Date: 24 Jun 2019 at 10:07am
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


Topic: RPG chr sheet (pdf)
Posted By: magnusprime27
Subject: RPG chr sheet (pdf)
Date 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?

 



Replies:
Posted By: try67
Date 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


Posted By: magnusprime27
Date 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 ;
 
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net