I am working on a workflow that calculates a new employee's available leave based on the employee's start date. If the start date was January 1st, they would get 15 days of leave. The leave value must be rendered in increments of .5 (1/2) days. So, if a person, based on their start date calculates to 3.8 days, I want it to round up to 4 days of available leave. If they have 6.1, I want t to round up to 6.5 days of available leave. The leave date should never round down in my use case.
Has anyone here ran across this problem before? Any ideas on a strategy to accomplish it?
Thanks and Regards,
Solved! Go to Solution.
"With the help of the Nintex support team, I discovered that there is no OOTB way to round a number to a nearest multiple."
Thanks Dean Virag! I think that the strategy might be figuring out how, via workflow actions, to evaluate the decimal place and substitute it. Scratching my head on that now. I will let you know if I figure it out.
I have had a little play and done the following:
it has made the following replacements for me:
1.0 = 1.0
1.1 = 1.5
1.2 = 1.5
1.3 = 1.5
1.4 = 1.5
1.5 = 1.5
1.6 = 2.0
1.7 = 2.0
1.8 = 2.0
1.9 = 2.0
Hi Cassy Freeman,
I came up with a very similar solution that I am debugging now. Since you did the leg work on this and it is a working solution, I will give you the correct answer on it. Thanks so much for the response and confirmation!
Would you mind explaining how you went around using regular expression to extract the decimal part of the number? I've not used it before and am finding it a little confusing.
I'm trying to do something similair but always have the number round up.