Stocks ended slightly lower Tuesday, with major indexes edging down from the previous session’s record finishes, after the June consumer-price index rose more sharply than expected. Investors were also parsing earnings data from banking giants JPMorgan Chase & Co. JPM, -1.49% and Goldman Sachs Group Inc. GS, -1.19%, which both closed more than 1% lower. The Dow Jones Industrial Average DJIA, -0.31% fell around 107 points, or 0.3%, to close near 34,880, according to preliminary figures, while the S&P 500 SPX, -0.35% lost around 15 points, or 0.3%, to finish near 4,369. The Nasdaq Composite COMP, -0.38% dropped around 56 points, or 0.4%, ending near 14,678. The consumer price index climbed 0.9% last month, the government said Tuesday. Economists polled by The Wall Street Journal had estimated a 0.5% advance.