The state of the economy can be confusing. Consumers, stung by high inflation for two years and navigating a slowing job market, are still spending at a decent clip — but on store-brand soda, not new refrigerators. That puts Walmart, the company that made low prices a mantra, in a good position.

The company said on Thursday that sales at U.S. Walmart stores rose just over 4 percent, to $115.3 billion, beating analysts’ estimates. Its U.S. e-commerce business jumped 22 percent.

Many see Walmart, the largest retailer in the United States, as a gauge for how American consumers are faring. Ninety percent of the U.S. population lives within 10 miles of a Walmart store.

Transactions during the quarter were up 3.6 percent, while the average amount spent per visit showed a slight increase, of 0.6 percent.

Notably, the company raised its full-year forecast for sales and profits, a signal of its optimism about attracting more shoppers. It said it gained market share with consumers across the income spectrum, with the richest households once again “primarily” driving those gains.

Walmart has said that, while it still emphasizes low prices on its sprawling range of products, it also has been investing in technology to upgrade its supply chain and e-commerce capabilities with the goal of making it easier and quicker to shop with the company.