financial_maths 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/financial_maths/version.rb +1 -1
- data/lib/financial_maths.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04b02170a3ad7239e2f09675d5cdd0a7589864c6
|
4
|
+
data.tar.gz: f8ab2f8c2007857eeb0f042cadc11037e819f0da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9af1f0dbce744ef3b590262e7505bfcd3472b7495d62a7f159cd9e2c5f3188a1053a899ec12403b023f1b6a0ca07d1029d917db25f1004020fc7a25db89c5236
|
7
|
+
data.tar.gz: 35021e2b5fe02bae0b64d2405041e785c34c79fe3e138f7f8cdf55da780b4a85ec4ba7d03bdafdbd6b595b716ec728abe0baa901c45a69c120b014cffb08690d
|
data/lib/financial_maths.rb
CHANGED
@@ -129,7 +129,7 @@ module FinancialMaths
|
|
129
129
|
# toAnticipated = nominalRate / 1 + nominalRate
|
130
130
|
# Returned -> toAnticipated * PERIODS
|
131
131
|
def nominal_anticipated_given_efective(effective_rate, periods)
|
132
|
-
nominalRate = (1+(effective_rate.to_f/100))**(1/periods.to_f)-1
|
132
|
+
nominalRate = (1+(effective_rate.to_f/100))**(1/periods.to_f)-1
|
133
133
|
toAnticipated = nominalRate / (1+nominalRate)
|
134
134
|
(toAnticipated * periods.to_f * 100).round(4)
|
135
135
|
end
|
@@ -145,7 +145,7 @@ module FinancialMaths
|
|
145
145
|
# Description: Find nominal rate expired given effective rate - EFNV
|
146
146
|
# Formula: (1 - ((1 / (TASA EFECTIVA + 1))^(1/PERIODOS))
|
147
147
|
def anticipated_interest(rate, periods)
|
148
|
-
(1 - (( 1 / ( rate.to_f + 1 )) ** (1 / periods)))
|
148
|
+
(1 - (( 1 / ( rate.to_f + 1 )) ** (1.0 / periods)))
|
149
149
|
end
|
150
150
|
|
151
151
|
# == End conversion rates
|