如何计算利息 [英] how to calculate interest

查看:89
本文介绍了如何计算利息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个Web应用程序,除其他功能外,该应用程序允许用户在其帐户上保留现金余额(可以随时兑现或用于在网站上购买商品).用户可以随时提取资金并将其存入他们的帐户.从来没有打算这样做,但是现在我们有一些用户在他们的帐户上留下了大笔款项,现在他们要求我们对他们的帐户余额提供一定的利息,这是完全合理的.问题是我们不知道如何计算用户可以随时提取和存入资金的帐户的利息,但是显然所有银行都这样做,所以我想知道是否存在一种标准的方法(或红宝石)来计算利息.任何指针或帮助都将不胜感激.

We have a web app that among other things, allow users to leave a cash balance on their account (which can be cashed out anytime or used to purchase items on the site). Users can withdraw and deposit funds to their account anytime. It was never intended for it, but we now have users who leave large sums on their account and they're now requesting that we provide some interest on their account balance which is totally reasonable. Problem is we have no idea how to calculate interest on an account where users can withdraw and deposit funds anytime, but all the banks obviously do it so I was wondering if there's a standard way (or ruby gem) to calculate interest. Any pointers or help is greatly appreciated.

数据库表的设置非常简单.

The db table setup is pretty simple.

用户有一个帐户

Accounts(user_id, balance)

帐户有很多活动

Activities(account_id, type, amount, description, created_at)

类型可以是存款"或取款".

Where type can be either "Deposit" or "Withdrawal".

推荐答案

对于使用哪种利息计算的答案,我同意Ray Toal的看法,您将不得不询问客户使用哪种利息计算以及他们的付款方式方案就像.

For the answer on what interest calculation to use I agree with Ray Toal that you are going to have to ask your client what interest calculation to use and what their payment scheme is like.

通常来说,提供支票帐户利息的金融机构是按每个工作日每天[在结束时?]计算的复利计算得出的,并在每个月底每月通过将存款直接存入帐户来支付.

Usually speaking, financial institutions that offer interest on a chequing account are calculated with compounding interest calculated daily [at the close?] of each business day and paid monthly at the end of each month by a deposit directly into the account.

值得注意的是,银行和其他金融机构将告知其客户每年的利率(APR),而不是每天的利率.这是我过去犯的一个基本错误.

Notably, banks and other financial institutions will tell their clients the interest rate on a yearly basis (APR) and not the interest rate per-day. It is an elementary mistake that I have made in the past.

这篇关于如何计算利息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆