Thanks to quickly rising interest rates, courtesy of the Federal Reserve's attempt to pump the brakes on inflation, 2022 was a year to forget for investors. The S&P 500, probably the most followed stock market index, lost 19% of its value. And investors are still trying to navigate an uncertain environment today. 

In times like these, investors should prioritize finding safe places to park their hard-earned capital. Known for being a recession-proof stock, Dollar General (DG 0.05%) deserves a closer look right now. Is this popular discount store chain deserving of a place in your portfolio? Let's find out. 

There's a lot to like about Dollar General 

Investors have a lot to be excited about when it comes to this top retail stock. In 2022, Dollar General increased revenue 10.6% year over year to total $37.8 billion. Same-store sales, a key performance metric for the business, jumped 4.3%. And diluted earnings per share were 5% higher than the 2021 figure.  

Posting healthy growth in this environment, a time when many companies are challenged, is good news for investors. Dollar General's sound financial position, with its ability to produce consistent free cash flow (FCF), affords shareholders peace of mind. In fact, Dollar General has long adopted shareholder-friendly practices. The business's annual dividend went from $0.88 in 2015 to $2.07 in 2022, a remarkable 135% increase. And during the last fiscal year, the company repurchased $2.7 billion of its stock. 

But returning all of that capital back to investors hasn't meant Dollar General's growth prospects are dim. The business opened 974 net new stores in fiscal 2022, bringing the total to 19,104 as of Feb. 3. Management has plans to open 1,050 new stores in fiscal 2023, a number that includes 2,000 remodels and 120 relocations. 

And the leadership team remains optimistic in the near term. "Our outlook for the year includes strong sales and operating profit, while also providing for investments intended to drive long-term sustainable growth," CFO John Garratt said in the earnings press release. Sales are expected to rise 5.5% to 6% in fiscal 2023. 

A safe stock to own 

One of the most attractive characteristics about Dollar General is how resilient the business is, something investors should appreciate in a highly uncertain economic period like the one the U.S. is currently in. If there's a recession in 2023, Dollar General is well positioned to continue posting solid numbers. 

During the Great Recession, Dollar General's revenue rose by double digits, climbing 10.1% in fiscal 2008 and 12.8% in fiscal 2009. This points to Dollar General's compelling value proposition to consumers, with the majority of its carried national brands and the company's private-label products priced below $10. It's hard to beat that, especially when you consider the range of items available. 

And with the Popshelf initiative offering non-consumables like beauty products and home decor, and DG Fresh offering groceries, the business is also focused on adding a wider assortment of merchandise that can entice shoppers to visit more often and spend larger amounts to meet all of their needs. The benefit to Dollar General is higher customer wallet share and loyalty, which can support greater revenue and profitability over time. 

Paying the right price 

Before deciding to invest in any stock, investors need to also consider the valuation. As of this writing, Dollar General's shares sell at a price-to-earnings (P/E) ratio of 20, which is cheaper than the stock's trailing three- and five-year average valuations, but on par with its 10-year trailing average P/E. The stock is trading at a small premium to the S&P 500, which carries a P/E of under 18. 

Taking all of this into account, I think it's an accurate assumption to view the shares as fairly valued right now, based both on their past valuation and looking at the level of the overall market. That being said, investors should instead focus on the favorable qualitative characteristics with this business. Dollar General is a stable and safe compounder, and it can provide a nice foundation to anyone's portfolio.