What is Price?

In ecommerce, Price is the exact monetary amount required from a customer to purchase a specific product variant in a given currency.

Price vs. Compare-At Price

To convey value during sales or promotional periods, stores display two distinct price attributes:

  • Price: The actual active selling price charged at checkout (e.g. $39.00).
  • Compare-At Price: The original manufacturer suggested retail price (MSRP) or non-discounted reference price (e.g. $50.00).

When Compare-At Price > Price, storefronts automatically calculate and render strike-through pricing and percentage-off badges:

$$\text{Discount (%)} = \left( \frac{\text{Compare-At Price} - \text{Price}}{\text{Compare-At Price}} \right) \times 100$$

Common Pitfall: Floating Point Currency

Developer Takeaway

Integer Cents Rule: Always store monetary amounts in the smallest currency unit as integers (e.g. 3900 for $39.00 USD) or fixed-precision DECIMAL(10, 2) strings to prevent rounding discrepancies during checkout tax calculations.