California Wal-Mart customers who spot any price-scanning errors will get $3 back at the cash register, under a deal with legal authorities.

The deal, which is part of a settlement with California’s attorney general and San Diego’s district attorney, is a response to customers being overcharged across the state. In an investigation that began in 2005, departments of weights and measures in several California counties found that 164 Wal-Mart stores in 30 counties had made scanning errors, overcharging customers an extra $8.40 at checkout, on average. Errors cited in a release included $1 overcharges on Kellogg's Special K cereal in Los Angeles and Santa Clara counties, and 46-cent overcharges on Kellogg's Rice Krispies cereal in Madera, King and Ventura counties.

Wal-Mart agreed to designate employees to ensure the accuracy of scanned prices and receive customer complaints. The company also will pay $1.4 million in restitution, civil penalties and reimbursement for investigative costs, and $50,000 to the State Consumer Protection Prosecution Trust Fund.