Progressive Tax Calculation Function | WordPress.org

[ad_1]

(function(){

if (fieldname2 <= 110000) return
fieldname2 * 0.15

if (fieldname2 <= 230000) return
110000 * 0.15 + (fieldname2 - 110000) * 0.20

if (fieldname2 <= 580000) return
110000 * 0.15 + (230000 - 110000) * 0.20 + (fieldname2 - 230000) * 0.27

if (fieldname2 <= 3000000) return
110000 * 0.15 + (230000 - 110000) * 0.20 + (580000 - 230000) * 0.27 + (fieldname2 - 580000) * 0.35

if (fieldname2 > 3000000) ;
110000 * 0.15 + (230000 - 110000) * 0.20 + (580000 - 230000) * 0.27 + (3000000 - 580000) * 0.35 + (fieldname2 - 3000000) * 0.40

})();

Hello @buptrick

Thank you very much for using our plugin. Your equation is correct. However, by using the MAX operation, you can implement the equation in one line of code without “if” conditional statements. However, as I said, your equation is correct.

The support service does not cover the implementation of the users’ projects. However, if you need someone to implement your project or equations, you can contact us via the plugin website. Contact Us

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer