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 ;

g = f.value;

h = ((g - (g % 2))) / 2;

if (h < 2) { h = 1 };

if (h > 0) { h = + h };

event.value = h ;

Use this:

var f = this.getField("LV");

g = f.value;

h = g / 2;

event.value = Math.floor(h);

]]>
g = f.value;

h = g / 2;

event.value = Math.floor(h);

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 ;

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?