Financial Calculations in JavaScript