I have written a script that will allow me to add a "," after each 3rd character. After looking at it again, I realised that the client brief stated that it needed to count from the back, not the front.
So $ 3000 should become $ 3,000. At the moment my script makes it $ 300,0 (ignore the $ as it is not part of the string)
Here is my script:
value.match(/.{1,3}/g).join(',')
Does anyone please have any advice about how I might update this to get the desired result? Or perhaps any advice on doing it in a different way?
Any advice would be greatly appreciated