I rent out caravans and am looking to offer pay monthly options. We have worked out a formula in Excel but need to convert it to PHP.
The excel formula is:
monthlyCost=SUM("holidayCost"/(roundDown(((("holDate"-30)-"todaysDate")/30),0)))
The problem is rounding the number down.
Example 1
Holiday Price = £400
Holiday Date = 1/7/2014
Monthly Cost = £100
Example 2
Holiday Price = £400
Holiday Date = 22/7/2014
Monthly Cost = £80
Example 2 is reduced as there is an extra month of payments due to the round down.
Can anyone help as we cannot work it out.
PHP Formula Help
Moderator: General Moderators
Re: PHP Formula Help
on another forum, RuleBritannia wrote: There is a function in php called http://uk1.php.net/roundreturns 9Code: Select all
round(9.5, 0, PHP_ROUND_HALF_DOWN);
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US