Whole Foods Market has agreed to pay nearly $800,000 to settle charges that it shortchanged customers across California by charging more than the advertised price for a variety of items, the Los Angeles City Attorney’s Office said Tuesday.

The case grew out of a yearlong investigation by weights and measures inspectors for the state and Los Angeles County. Whole Foods cooperated with the inspectors during their investigation.

Among the steps needed for remediation, Whole Foods will pay $798,394 in costs and penalties and appoint “state coordinators” to oversee pricing accuracy at all 74 of its California stores.

“We’re taking action to assure consumers get what they pay for,” Los Angeles City Attorney Mike Feuer said in a statement. “No consumer should ever be overcharged by their local market.”

The agreement is between the company and city attorney’s offices in Los Angeles, Santa Monica and San Diego.

“Whole Foods Market takes our obligations to our customers very seriously, and we strive to ensure accuracy and transparency in everything we do,” said Marci Frumkin, executive marketing coordinator for the company’s Southern Pacific Region. “Based on a review of our own records and a sampling of inspection reports from various city and county inspectors throughout California, our pricing on weighed and measured items was accurate 98 percent of the time. While we realize that human error is always possible, we will continue to refine and implement additional processes to minimize such errors going forward.”

Monetary damages include $630,000 in civil penalties, $100,000 paid to a statewide consumer protection trust fund and $68,394 in investigative costs. The Los Angeles city attorney will receive $210,000 in civil fines.

Investigators determined that Whole Foods failed to deduct the weight of containers when ringing up charges for self-serve foods at the salad bar and hot bar, giving customers less weight than the amount stated on the label for packaged items sold by the pound. It also sold its prepared deli foods by the piece instead of by the pound, as required by law.

Whole Foods will designate an employee at every outlet in the state to verify pricing and conduct random audits four times per year to ensure all policies are being carried out properly.

The injunction will remain in place for five years.