Nikki's first error was:
She should have divided the cost of the carton by the number of eggs to find the price per egg.
To correctly calculate the unit price, she should use the formula:
\[ \text{Unit price} = \frac{\text{Cost of carton}}{\text{Number of eggs}} \]
For the 12-egg carton: \[ \text{Unit price} = \frac{2.39}{12} \approx 0.1992 \text{ per egg} \]
For the 18-egg carton: \[ \text{Unit price} = \frac{3.39}{18} \approx 0.1883 \text{ per egg} \]
By comparing these unit prices, you can determine the better buy based on the lower price per egg.