Skip to content

Instantly share code, notes, and snippets.

@queued
Last active January 4, 2019 03:45
Show Gist options
  • Save queued/bb2280a9a2f6bc0161225b567152b7c4 to your computer and use it in GitHub Desktop.
Save queued/bb2280a9a2f6bc0161225b567152b7c4 to your computer and use it in GitHub Desktop.
<?php
$now = 100.00;
$months = 12;
$monthly = 100.00;
$tax = 6.5;
if ($monthly) {
$result = ($monthly * (((1 + $tax / 100) ** $months) - 1) / ($tax / 100));
} else {
$result = ($now * (((1 + $tax / 100) ** $months)));
}
$profit = $result - $months * $monthly;
echo "You will have: " . number_format($result, 2);
echo "\n";
echo "Profit of: " . number_format($profit, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment