SAN FRANCISCO — A federal appeals court has upheld a $41.8 million judgment against Safeway Inc. in a lawsuit claiming the grocery chain overcharged customers who used its online delivery service.

The U.S. Court of Appeals for the Ninth Circuit upheld a ruling from U.S. District Judge Jon Tigar of the Northern District of California that found “extrinsic evidence” in the case supported the customers’ reading of an ambiguously worded product pricing clause in an agreement governing online grocery sales.