Nodejs code implementation to calculate whether it is appropriate to pay social security _node.js

Source: Internet
Author: User

According to an average programmer 8000 of the monthly income is 1800 of social security, and to delay the retirement of 65 years old, I was 30 years old, this account and balance treasure Compare, I immediately understand

Copy Code code as follows:

Fuckshebao:function (req, res, next) {
1800 per month of social security
var day = (1800/30);
Pay 15 Full
var full_days = 365 * 15;
Retire at age 65
var old_days= 365*35;
var i = 0;
var p = 0;
var total = 0;
Time flies.
while (I < full_days) {
Total = Total + day;
i++;
Total = Total + (total * 1.16/10000);
}
15 years later, that's a lot of money.
var year15 = total;
No more, continue to put interest (balance treasure)
if (i = = full_days) {
while (P < (old_days-full_days)) {
Total = Total + (total * 1.16/10000);
p++;
}
}
Settle out:
var all = (total+ ""). Tomoney ();
Year15 = (year15 + ""). Tomoney ();
var re = {all:all, year15:year15};
Res.json (re);
}

Results:

{
"All": "1070226.48",
"Year15": "458919.44"
}

Results 15 years later can have 45.8w, and to retire when 65 years old can have 107w, or not pay!

Hey, don't say anything, some party pit dad Ah

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.