How to abbreivate numbers

How do I make a number 50000 to 50,000

I’m not that good when it comes to formatting strings/numbers, But i think you could try using this?