Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^3: Calculating Number Of Pay Periodsby thanos1983 (Parson) |
on Oct 09, 2017 at 14:07 UTC ( [id://1200994]=note: print w/replies, xml ) | Need Help?? |
Hello 1nickt, You are right the year has 52 weeks and 1 or 2 day(s) depending upon the number of days in the year. Sample of calculation on calendar common year 365 days:
Sample of calculation on leap year has 366 days, when February has 29 days:
I was counting the remaining days as a week. So the solution is to remove the last input and count in total the remaining weeks: Sample bellow before and after:
BR / Thanos
Seeking for Perl wisdom...on the process of learning...not there...yet!
In Section
Seekers of Perl Wisdom
|
|