Another way to compare
Dividing to find a unit price works, but the decimals can get messy. Another strategy is to write each deal as a rate in fraction form and scale it to make equivalent fractions.
For example, 6 bars for $4.50 can be written as $4.50/6 bars. Multiply the top and the bottom by 4:
$4.50/6 bars = $18.00/24 bars
The rate hasn't changed. It's the same deal, just more of it. If you scale two deals to the same quantity, the cheaper price wins.