Hi Everyone,
I created the following Script and there are no errors. I am trying to figure out how many packages are needed by dividing the Quantity Shipped / Pack Qty. The issue is I do not know how to ROUNDUP in the Sage 100 Scripts.
Example #1: 99 / 3 = 33 packages, which is good
Example #2 100/3 = 33.33 packages. I want it to be 34 packages, not round down to 33 packages.
---
numQuantityShipped = 0
numPackQty = 0
numPackageCount1 = 0
numPackageCount = 0
retVal = oBusObj.GetValue("QuantityShipped", numQuantityShipped)
retVal = oBusObj.GetValue("UDF_PACK_QTY", numPackQty)
if numPackQty = 0 then
numPackageCount = numQuantityShipped
retVal = oBusObj.SetValue("UDF_Package_Count", numPackageCount)
end if
if numPackQty <> 0 then
numPackageCount1 = numQuantityShipped / numPackQty
numPackageCount = round(numPackageCount1,0)
retVal = oBusObj.SetValue("UDF_Package_Count", numPackageCount)
end if
---
ISSUE ARISES WHEN I Change:
numPackageCount = round(numPackageCount1,0)
to
numPackageCount = roundup(numPackageCount1,0)
I get an ERROR 88 by using ROUNDUP.
Is there a way to Round Up in the Sage 100 Scripts?
Any help would be appreciated...