Created
March 11, 2024 13:23
-
-
Save camilonova/1ac50f91db7ab6381836a93fa21e963b to your computer and use it in GitHub Desktop.
Calcular tasa de interes mensual a partir de tasa efectiva anual
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
function calculate(annualRate) { | |
// annual-rate could be integer 20 (as in 20%) | |
var periods = 12; // months in a year | |
var monthlyRate = ((Math.pow( (1 + (annualRate / 100) ), (30/360) ) - 1) * 100).toFixed(2) | |
return monthlyRate + "%"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment