20 lines
569 B
Plaintext
20 lines
569 B
Plaintext
MAIN
|
|
DEFINE ppmt DEC(12,6)
|
|
CALL calculapmt(100000,6,360) RETURNING ppmt
|
|
|
|
DISPLAY "DATA ",ppmt
|
|
END MAIN
|
|
FUNCTION calculapmt(monto_prestamo,inta,plazo)
|
|
DEFINE intm,p_intm_m1,p_intm,interesm,pmt,monto_prestamo,inta,plazo,factor,factor1 DEC(12,6)
|
|
|
|
LET intm = ((inta/100) / 12)+1
|
|
LET interesm = (inta/100) / 12
|
|
LET p_intm_m1 =fgl_decimal_power(intm,plazo ) -1
|
|
LET p_intm=fgl_decimal_power(intm,plazo )
|
|
LET factor = p_intm * interesm
|
|
LET factor1 = factor*interesm
|
|
LET pmt = monto_prestamo/( p_intm_m1/factor)
|
|
|
|
|
|
RETURN pmt
|
|
END FUNCTION |