Don't write code until you know what you want to write.
How can you convert a rate for 8 weeks or 2 weeks into a rate for 1 week?
You can't.
You could possibly make an estimate.
weekly_rate = rate / number_of_weeks;
Is that what you want to calculate?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Registration is open
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss. Register now and lock in 2025 pricing—just $495!