$preTaxAmount = '1000'; $taxPerc = 3.00; // (CGST = 1.50 + SGST = 1.50) $gstAmount = number_format($preTaxAmount * ($taxPerc) / 100, 2, '.', ''); $postTaxAmount = number_format($preTaxAmount + $gstAmount, 2, '.', '');