NodeJS code is suitable for calculation and social security protection? _ node. js

Source: Internet
Author: User
This article uses a specific example of nodejs to compare and analyze the current situation of our social security cooperation is not suitable, mainly for a small application of nodejs, of course, you can also change to other languages, programmers, let's calculate it. According to an ordinary programmer, 8000 of the monthly income is 1800 of the social security fund, and I will be 30 years old after I retire at the age of 65. This account is compared with Yuebao, and I suddenly understand it.

The code is as follows:


FuckShebao: function (req, res, next ){
// 1800 of social security every month
Var day = (1800/30 );
// Make the payment within 15 years
Var full_days = 365*15;
// Retire at the age of 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 );
}
// It will be so much money in 15 years
Var year15 = total;
// If you do not pay any more, continue to pay the interest (Yu'E Bao)
If (I = full_days ){
While (p <(old_days-full_days )){
Total = total + (total * 1.16/10000 );
P ++;
}
}
// Settlement:
Var all = (total + ""). toMoney ();
Year15 = (year15 + ""). toMoney ();
Var re = {all: all, year15: year15 };
Res. json (re );
}

Result:

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

As a result, there will be 45.8 million in 15 years, and 107 million in 65 years after retirement!

Ah, I don't want to talk about anything. some party is a tough guy.

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.