Nodejs code implementation to calculate whether social security is appropriate

Source: Internet
Author: User

This article through a concrete example of Nodejs to compare and analyze at this stage we do not fit the social security,

The main is a small application of nodejs, of course, we can also change to other languages, program apes, to calculate it.

8000 of a regular programmer's monthly income is 1800 of the social Security benefits, and is deferred to 65 years of retirement. The code is as follows: Fuckshebao:function (req, res, next) {       //monthly 1800 Social Security         var day = (1800/30);       /15 full         var full_days = 365 * 15;       //To 65 years old retirement         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 is so much money         var year15 = total;       //no longer handed in, following Continuation interest (balance treasure)         if (i = = full_days) {            while(P < (old_days-full_days)) {                total = total + (total * 1.16/10000);      &NBSP ;         p++;           }       }    &NBS P  //Settlement out:        var all =   (total+ ""). Tomoney ();        YEAR15 = (year1 5 + ""). 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 65 years old can have 107w, or do not pay!

Turn from (http://www.jb51.net/article/61885.htm)

Nodejs code implementation to calculate whether social security is appropriate

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.