$('.price').text((i, text) => {
const [ price, currency ] = text.split(' ');
return `${(+price).toLocaleString()} ${currency}`;
});
const split = text => text
.split('')
.reduceRight((acc, c) => (acc[0] && acc[0].length < 3)
? (acc[0].unshift(c), acc)
: (acc.unshift([c]), acc),
[])
.map(x => x.join(''))
.join(' ')