Skip to Content

Rounding in Time Off is a bit complex and sometime, getting precise result is difficult. In this article I will discuss about a scenario of rounding Leave Accrual to next multiple of 0.5. For example, while calculation of Leave Accrual if result is 1.2, it should be rounding to 1.5 and if value is 1.6, it should be rounding to 2.

 

To achieve above requirement, I have tried an alternate method. I will describe it in following steps –

 

  1. Create a new Custom Object (Say accrualRound) with following fields –
    1. externalCode
    2. Cust_roundTo
    3. Cust_max
    4. Cust_min

 

  1. Create a data file where data in columns were having a difference of 0.5(as per my requirement). Screenshot is shown below –

 

 

  1. In my accrual rule I have written following logic –

 

 

Result –

 

Whenever above Accrual Rule will be execute, at time of Time Account Creation, it will check the lookup table and pick up the correct Rounding value.

Eg. Before Time Account creation, if variable amount is (suppose) 2.67, Rule will read the lookup table and pick round to value from fifth row i.e. 3.

 

Hope this solution will help you in rounding of Accrual.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply