Hello,
Any idea how to round the sum of the two conditions below? I'm not sure how to write the code to achieve this. Thank you!
This is our code in the salary rule:
if worked_days.WORK100:
result = worked_days.WORK100.number_of_days
if worked_days.WORK110:
result += worked_days.WORK110.number_of_days
basically we want to get the sum first before rounding the value so adding just round() after the = sign wont do.
Hello,
Could you just round before assignment? I assume after this statement you assign the variable result to a value on worked_days.
if worked_days.WORK100:
result = worked_days.WORK100.number_of_days
if worked_days.WORK110:
result += worked_days.WORK110.number_of_days
# variable assignment
worked_days.sum = round(result)
Does this work?
Hi Jack,
i am getting this error "Wrong python code defined for salary rule"