View Full Version: Decimal Places?

LawsonTalk > BCI, Processflow and Addins > Decimal Places?



Title: Decimal Places?


vc727 - September 18, 2007 01:41 PM (GMT)
I am working on a Job Requisition approval flow that calculated available fte based on assigned resources active requisitions and the requisition being requested. what I am running into is when I do a calculation on the FTE it turns the number from a simple one decimal place to a 16 decimal place mess. for example it turns .4 into .3999999999999998 which reall messes with my calculations. does anyone know how to limit the decimal places when using the Double data type? or know why it would be rounding so funny?

Thanks

shanesmj - September 19, 2007 03:10 AM (GMT)
The following should work for you...

(parseFloat(VARIABLE) / 1000000.0).toFixed(0)


Here is an example from one of my flows:

(parseFloat(EmpInfo_NEW_VALUE_1) / 1000000.0).toFixed(0)

You might need to change the number of 0's for the divide by but it is working well for my flow.

Good luck
Shane

vc727 - September 24, 2007 12:11 PM (GMT)
Thanks I'll try that.

MannieJ - September 24, 2007 03:41 PM (GMT)
There is a javascript function in processflow called round.The format of the function is round(num, decimalPlaces).

vc727 - October 3, 2007 04:22 PM (GMT)
That worked thanks




Hosted for free by InvisionFree