制作带空间的收件箱

I'm making an inbox, with space, i've decided that you could have MAX 200 messages, i counted (inbox+outbox) and now im trying to make a "spacemeter"

You'r using 20% of your space

My question now, how could i count this to percent? So it always gets 100% if there is 200 messages?

I have two variables with numbers $got and $sent and then i count them with $total = $got+$sent

I'm sorry for a bad explination if you dont understand i will try to explain better!:)

This is basic math.

$percentage_of_space = ($total / 200) * 100  ;

this can be obtain like this

$total_max_messages = 200; // max limit of your inbox+outbox
$inbox_msg = 10; // inbox msg count
$outbox_msg = 15; // outbox msg count

$total_msg = $inbox_msg + $outbox_msg; // total msg (inbox+outbox)

$used_space = ($total_msg/$total_max_messages) * 100; // in percentage
$left_space = 100 - $used_space; // in percentage