JavaScript for Convert String to Number
Hello
I have a concatenated field with custom script below:
var s1 = this.getField("Leave Yard Hour").valueAsString;
var s2 = this.getField("Leave Yard Minutes").valueAsString;
// Set this field value by concatenating the field values
event.value = s1 + "." + s2;
-------------------------------------------
Then in another field - I'm trying to parse it into an integer and then do a calculation for the difference using the below but it is not working:
// Get first field value
var v1 = getField("Leave Yard Total").value;
var v1 = parseInt("Leave Yard Total")
// Get second field value
var v2 = getField("Arrive Job Total").value;
var v2 = parseInt("Arrive Job Total")
// Set this field value equal to the difference
event.value = v2 - v1;
------------------------------------------------------------------
any help is greatly appreciated
