Posted: 23 Feb 2018 5:51 EST Last activity: 26 Feb 2018 5:24 EST
Round off Days using function
I have a Requirement for Round function. Note: < 15 days = no roundoff
>15 days = roundoff to next month (added 1month
Like if it is 1 year 10 days we need to display 1 year only
and if it 1 year 16 days we need to display 1 year 1month
So 1 year 2 months 16 days should be round off to 1 year 3 months like this....
Can you please let us know, how is your input going to be like ?
Is it going to be a 3 combination strings like :
Years : 4 Months : 6 Days : 7
Expected Output : will be updating the months string to 6 and days string to 0 ?
Years : 4 Months : 6 Days : 17
Expected Output : will be updating the months string to 7 and days string to 0 ?
Is this what you want ?
Please let me know if my understanding is correct.
We can surely achieve this using an activity, where we can check the days count by parsing the days string and then set the days to 0, incrementing or decrementing the months using a condition on days count and then evaluate the year too (if incase the month is already 12 and the days is > 15, year has to be increased).