Forum Moderators: coopster

Message Too Old, No Replies

percentage calculation in php

         

lindajames

9:40 pm on Feb 3, 2005 (gmt 0)

10+ Year Member



hello.. i have the following calculation code that adds the $total and the $tax variables..

number_format($total+$tax,2,'.','')

can someone tell me how i can calculate the total and then subtract 15% of the final value..

thank you.

willybfriendly

9:51 pm on Feb 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



$t = round($t-($t * .15), 2);

Or, use ceil() or floor()

WBF