Dollar General and Dollar Tree storesGetty ImagesShares of Dollar General and Dollar Tree popped Thursday, as the discounters beat Wall Street’s quarterly earnings expectations, raised outlooks for the coming year and spoke of consumers flocking to lower prices during inflationary times.As of midday Thursday, shares of Dollar General were up about 14% and Dollar Tree were up about 20%.The two retailers said they see opportunity to grow as Americans weigh value more heavily in their purchasing decisions, whether buying groceries or seasonal decor.”We’re already starting to see our core customers start to shop more intentionally,” Dollar General CEO Todd Vasos said on a call with analysts. And we’re starting to see that next tier of customers start to shop with us a little bit more as well.” Dollar Tree Executive Chairman Rick Dreiling listed the many challenges that consumers are facing, from the highest levels of inflation since the early 1980s to record high gas prices and uncertainty from current events like the Ukraine war and the pandemic. He added that many consumers “are living paycheck to paycheck.””In tough times, value retail can be part of the solution to help families stretch their dollars to meet their evolving needs,” he said.Dollar General and Dollar Tree beat expectations on fiscal first quarter earnings, revenue and same-store sales.Dollar Tree, which includes the Family Dollar banner, said it now expects net sales for the year to range from $27.76 billion to $28.14 billion compared with its previous expectations between $27.22 billion to $27.85 billion. Dollar General said it expects net sales growth of about 10% to 10.5% compared with its previous expectation of about 10%. It raised its same-store sales forecast to growth of approximately 3% to 3.5% compared with its previous expectation of 2.5%.Here are three major takeaways from the two discounters fiscal first-quarter earnings reports:A different merchandise mixShoppers are still coming to stores, but are buying different items. Food is a bigger part of baskets and drove sales for Dollar General and Dollar Tree in the fiscal first quarter.A year ago, consumers had extra dollars from stimulus checks and child tax credits. That meant some sprang for impulse items or discretionary purchases. Those dollars have disappeared and other budget items, such as groceries and gas, have become pricier.Vasos said same-store sales at Dollar General dropped in each of the seasonal, apparel and home products categories in the fiscal first quarter, but more consumables sold. Overall, same-store sales dropped 0.1% versus the year-ago period, besting the 1.3% decline anticipated by analysts, according to FactSet.At Dollar Tree, carbonated beverages, salty snacks and cookies were some of the items that surged in popularity — especially as the retailer expanded its food and beverage assortment. The company is the parent of Family Dollar, a banner that skews more heavily to food compared with the namesake banner.”We believe that’s a traffic driver and as the customers experience the items and appreciate the value we’re giving them, over time we believe that that will help drive traffic into the overall store, not just those categories,” Dollar Tree CEO Michael Witynski told analysts.Sales patterns at the companies echoed those at Walmart and Target, two companies that also saw a shift toward groceries and away from general merchandise in the fiscal first quarter.Seizing the momentEven before inflation jumped to a four-decade high, Dollar Tree and Dollar General had plans for larger store footprints, expansion into new categories and strategies to woo more customers. The retailers doubled down on that on Thursday — saying the challenged economic backdrop makes the time right and the offerings more compelling.Dollar General, which has more than 18,000 stores, will open 1,100 new locations this year. It will expand its new store concept, PopShelf, and press ahead with the addition of more health-related merchandise. And it will go global by opening up to 10 stores in Mexico by the end of this year.The company is going bigger with its stores, too. About 800 of the new locations will be its larger format of 8,500 square feet, with extra aisles for health and beauty items and coolers that hold produce or other groceries, Chief Financial Officer John Garratt told analysts on the call.Dollar General is adding more end caps and displays that emphasize its cheaper private label and its $1 items, Vasos said. He said the company has “seen an acceleration in our private brand business” in recent weeks.Dollar Tree, which includes more than 15,500 stores, is opening 590 stores this year. It is adding a larger range of goods by raising the price of $1 items to $1.25 and adding merchandise with a $3 and $5 price tag. And it has brought in new executives to turn around its Family Dollar banner.Managing higher costsDollar Tree and Dollar General weren’t immune to higher costs in the first quarter, and some investors have raised concerns about whether they can keep prices low without hurting profits.So far, the retailers have managed to beat Wall Street’s earnings expectations despite higher prices of fuel, freight and more. That’s something that Walmart and Target did not do.Vasos said Dollar General can trade to other items or trade down in sizes if particular goods rise in price. He said the company is closely managing inventory to avoid a high level of markdowns and excess items that don’t sell.Dollar General has a few other cost-saving and profit-driving measures underway, too. It added self-checkout to more than 8,000 stores as of the end of the first quarter. It plans to turn about 200 stores into self-checkout only this year. It is more than doubling its private fleet of trucks from 2021, so they account for about 40% of its outbound transportation fleet by the end of the year. And it is carrying more health care products, such as cough and cold medication, which have better margins than food.At Dollar Tree, a price hike has been a big boost for profitability. The retailer announced last year that it would raise the price of dollar items by a quarter. It is rolling out $3 and $5 items to more stores, too.Witynski said that wider range of price points means new sales opportunities in key seasons, like the holidays. He said Dollar General had strong sales around Easter and Valentine’s Day and anticipates a similar dynamic in the back half of the year with back-to-school, Halloween and the holiday season.