The practice known as psychological pricing, or odd pricing, was invented in the United States in the 19th century. https://en.wikipedia.org/wiki/Psychological_pricing
Ironically, the original rationale was not to make prices appear lower, but rather to guarantee that customers would receive at least a penny (worth something at the time), in change. One theory is that it was a theft control device to force cashiers to make change (and thereby record the sale) on the newly invented cash register. Another theory is that a newspaper seller who priced his papers at one penny encouraged his advertisers to price their products at X.99, thereby giving back a penny of change for each purchase that could be used to buy the paper itself.
It was only later, in a statistically-driven20th century that marketers realized that customers tended to ignore, or at least underweight the odd cents in calculating the price of products. Once this realization took hold, the practice became widespread.