Skip to content

Instantly share code, notes, and snippets.

@mahelbir
Created August 21, 2022 21:13
Show Gist options
  • Save mahelbir/6165da9566c53dedb4a1dde8872045c5 to your computer and use it in GitHub Desktop.
Save mahelbir/6165da9566c53dedb4a1dde8872045c5 to your computer and use it in GitHub Desktop.
Kur Korumalı Vadeli Mevduat Faizi Hesaplama
function kkm(charge, startRate, endRate, days=92, percentage=17){
let interest = charge * (percentage / 100) * (days / 365);
let forex = (endRate - startRate) * (charge / startRate);
if(forex > interest){
return forex + charge;
} else {
return interest + charge;
}
}
@mahelbir
Copy link
Author

kkm(1000000, 13.25, 14)
// 1056603.7735849055

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment