mardi 24 mars 2020

php if statement rewrite with comparison and calculation

Am writing a statement where basis Engine, tax is calculated on value as provided of @a in price However, issue is there is a minimum tax which is applicable if the tax is too low Like for calculated tax

  1. 5.5% or Rs 20000 (whichever higher) if eng < 800
  2. 5.5% or Rs 33000 (whichever higher) if eng > 800

    if ($eng < 800)
                    {           
                        $calculatedtax = (.055*$a);
                    }
    
    else if (($eng > 799)
                    {           
                        $calculatedtax = (.055*$a);
                    }               
    

    However, issue is unsure on how to make if comparison in above like eng < 800 then make comparison with 20000 and higher of value is saved in $calculatedtax

Aucun commentaire:

Enregistrer un commentaire