Get-Payment (modification of post by Stahler view diff)
diff | embed code: <script type="text/javascript" src="http://PoshCode.org/embed/708"></script>download | new post
Calculates a loan payment amount given Loan Amount, Interest Rate/Period (i.e. 7.5%/12) and Total number of payments.
Get-Payment 20000 .00625 60
- function Get-Payment {
- param ( $LoanAmount, [double]$InterestRatePerPeriod, $NumberPayments )
- $a = $LoanAmount
- $b = $InterestRatePerPeriod*[math]::Pow(($InterestRatePerPeriod + 1),$NumberPayments)
- $c = [math]::Pow((1+$InterestRatePerPeriod),$NumberPayments) - 1
- $payment = $a*($b/$c)
- "{0:C}" -f $payment
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
PowerShell Code Repository