It's called psychological pricing, and even though people are aware that everything is priced ending with 99¢ we still gravitate towards those slightly-lower prices. But, how long has this been going on? It must have started sometime with price sticker guns, or maybe with the UPC code? Nope: here's an article from 1898 outlining the psychological preference for prices ending in 9.
"There is a fascination in odd numbers that always draws purchasers. Now, I will call your attention to some of the marked-down articles that are being sold on our bargain counter. Notice those neckties that are marked at 37½ cents' three for a dollar; it is an actual fact that we sold twice as many of them at 37½ cents as we would sell at 35, and we sell as many again by allowing three for $1. When a man sees them selling at 37½ cents he naturally imagines that they are 50-cent goods, and he reasons that he can get three cheaper than he can one, so he takes three. He really does get a bargain, but he would not take it at a less attractive figure.
"Speaking of odd numbers, it is a curious fact that some are much more attractive than others. Nine cents, for instance, is one of the most attractive figures, and sells more goods than 8 cents would. Thirteen and 17 cents are by no means so good as 19 cents for running off an extra line, while 21 and 23 are comparatively poor sellers. Thirty-seven and a half cents is a great favorite, and better than 39 by far. Forty-nine used to be much better than it is now. I attribute the fact that it is less popular to the number of jokes that have been made upon it.
"When you get above 50 cents people commence to look more at the real value of a thing and less at the price charged. Seventy-nine cents is a great favorite, and 99 is one of the best figures still that we have to sell at, although not so good as it used to be. It will sell, however, 25 per cent. more goods than $1."—Washington Post.
This appeared in the Bismarck (ND) Tribune on 5 September, 1898, but is attributed to the Washington Post; it also appeared in the August 1898 edition of the Practical Druggist and Review of Reviews, and a number of other local newspapers as a wire story.
This was at a time when a penny was the equivalent of a quarter today: the difference between $1.99 and $2.00 had a genuine impact on a shopper's pocketbook, unlike today when it's an accounting fudge that only adds up over a week's worth of transactions.
Note: I did try to figure out what "jokes" the number 49 precipitated at the time, but the only possible connection I could think would be regarding the 1849 gold rush, which seems an odd thing to dissuade shoppers, so the actual jokes may be an 'improper' sort of thing to print in the paper.
But, when it comes down to it, retailers have been using psychological pricing for at least a hundred and twenty years, encouraging people to buy products with nines in the prices. Like today, your grandmother probably knew about the pricing tricks -- but like today, still bought them anyway!