// integer division // What percentage is "after" of "before" expressed as number 0..100 percent int percent = ( after * 100 ) / before; // truncated down int percent = ( after * 100 + before - 1) / before; // rounded up int percent = ( after * 100 + before/2) / before; // rounded