Skip to content

Instantly share code, notes, and snippets.

View jc-rses's full-sized avatar

Rostyslav Ses jc-rses

View GitHub Profile
@jc-rses
jc-rses / PV.js
Created April 19, 2023 13:30 — forked from ghalimi/PV.js
PV Function
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function PV(rate, periods, payment, future, type) {
// Initialize type
var type = (typeof type === 'undefined') ? 0 : type;
// Evaluate rate and periods (TODO: replace with secure expression evaluator)
rate = eval(rate);
periods = eval(periods);