Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HugoHeneault/e7f4e43ea129d4f85727dcc0309cd200 to your computer and use it in GitHub Desktop.
Save HugoHeneault/e7f4e43ea129d4f85727dcc0309cd200 to your computer and use it in GitHub Desktop.
Calcul de l'impot français par tranche (javascript)
// http://www.impots.gouv.fr/portal/dgi/public/popup?espId=1&typePage=cpr02&docOid=documentstandard_6182
function impotBareme(montant){
var impot = 0;
var tranches = new Array();
tranches.push([6011, 0]);
tranches.push([11991, 0.055]);
tranches.push([26631, 0.14]);
tranches.push([71397, 0.30]);
tranches.push([151200, 0.41]);
for(var i = 0; i < 4; i++){
if (montant >= tranches[i][0]){
danslatranche = tranches[i][0];
impot += danslatranche * tranches[i][1];
montant = montant - tranches[i][0];
}else if (montant < tranches[i][0]){
impot += montant*tranches[i][1];
montant = 0;
break;
}
}
if (montant > 0)
impot += montant*0.45;
return Math.round(impot, 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment