The UK inflation rate hit 3.2% in the year to August, according to the latest official figures.