How do I calculate the percentage of a number? [closed] February 23, 2023 by Tarik $percentage = 50; $totalWidth = 350; $new_width = ($percentage / 100) * $totalWidth;