The total amount of any purchase is computed as the sum of products of quantity and price.
_____
In some instances is is helpful to keep the units (dollars) with the numbers they apply to. Most times, the units will be left off, and you're expected to make sure they work out properly some other way.