To find 30% of a variable
1 2 3 4 5 6 |
// $budget = 100; $thirtypercent = ($budget * 30 /100); //$thirtypercent will equal 30 |
Most of the time is *100, but here it is…..
1 2 3 4 5 6 7 |
$x = 3; $y = 15; $percent = $x/$y; $percent_friendly = number_format( $percent * 100, 2 ) . '%'; |