Last active
July 13, 2021 17:17
-
-
Save qst-exe/0c03a05bb907b77710cf3842a681ab46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types=1); | |
$property_list = [ | |
[ | |
"name" => "物件A", | |
"price" => 50000000, | |
"income" => 5000000, | |
"expenses" => 1000000, | |
"purchaseExpenses" => 3000000, | |
], | |
[ | |
"name" => "物件B", | |
"price" => 40000000, | |
"income" => 1800000, | |
"expenses" => 390000, | |
"purchaseExpenses" => 1000000, | |
], | |
]; | |
foreach ($property_list as $property) { | |
$grossRate = number_format(($property['income'] / $property['price']) * 100, 1); | |
$netRate = number_format((($property['income'] - $property['expenses']) / ($property['price'] + $property['purchaseExpenses'] )) * 100, 1) ; | |
echo $property['name'] . PHP_EOL; | |
echo "表面利回り ${grossRate}%" . PHP_EOL; | |
echo "実質利回り ${netRate}%" . PHP_EOL . PHP_EOL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment