I'm guessing you are right, Diane, and they total then tax rather than the other way around. I'm also guessing that unless you are making a fairly high cost purchase of many items, the difference is negligable, as in a penny or two.
In the brief experience I had years ago with collecting taxes and then filing and paying the state quarterly, you reported total sales on which taxes were due/collected, then figured the percentage on that total, and paid that. The state didn't ask how much you collected, so if it came out a few cents more or less than you had collected, well, whatever. You still paid the amount due based on total sales for the quarter. So who knows how that all plays out for a business that collects thousands of $ in taxes on millions of $ in sales. I would bet that the amount they end up paying is different than the amount they collected every time. So each customer who buys multiple items is just a miniature version of that.