Skip to content

Instantly share code, notes, and snippets.

@wendylauw
wendylauw / PV.js
Created September 5, 2019 04:36 — 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);