Skip to Content
Menu
This question has been flagged
2 Replies
8352 Views

I don't understand. Even if the GROSS of the employee is 437.50 $, my condition always return 222...  Weird.

if categories.GROSS == 1000:

    result=15.30

elif categories.GROSS == 437.50:

   result=6.69

else:

   result=222

idea?

See example :

Avatar
Discard
Best Answer

May be a problem of rounding. You are comparing floats. Be better:

if abs(categories.GROSS-1000)<0.0001:

 

Avatar
Discard
Author

BIG THANKS!!!

Best Answer

It seems that ther is a confusion between the Category "GROSS" and the rule "GROSS" !

Usually, categories.GROSS means the sum of all rules which belong to this category. Do you have any of such rules ?

Look under:Salary Rule Categories Hierarchy

--added after question modification---

I started to edit my answer before you edit your question (I did not see the added image).

My response remains valid.

I suppose that the related rule is AE, in this case just replace categories.GROSS by GROSS.

 

Avatar
Discard
Author

Thanks a lot for your time. I have this category. I have corrected the post.