Effortlessly add thousands separators to numbers in AutoHotkey with this simple trick
Channel: AUTOHOTKEY Gurus
Date: 2022-11-09

In this video I show you how to easily add the thousands separator to a number in AutoHotkey.   The RegEx function lets you choose your separator so you can easily add a comma, period, or any character, to numbers like this: 11111111   and get numbers like this:  11,111,111  

Learn more about Regex here:  https://the-Automator.com/RegEx

Below is the code I use in the video

;********************RegEx by Maestrith***********************************
Pretty(1111,",") ;add comma as seperator
Pretty(Number,Separator:=","){
 return RegExReplace(Number,"\G\d+?(?=(\d{3})+(?:\D|$))","$0" Separator)
}
TLDR: Regex can be used to simplify code and automate tasks.

1. 00:00 🔢 Use a regex formula to add delimiters to numbers without commas.
 1.1 Add a delimiter to a number without commas using a regex formula.

2. 00:31 🤩 My Pretty Function is a new function created by Mainstreet.
 2.1 Mainstreet wrote a function, which is now being shared as "My Pretty Function".

3. 00:45 🔨 Split a value into an array using a delimiter with a function.
 3.1 Pass a value and delimiter to a function to convert it.

4. 00:53 🤔 Making a TLDR requires keeping the most important events and ideas, being concise, and starting with an appropriate emoji.
 4.1 Increasing the size of the comma changes it to a period.

5. 01:12 🤔 Knowledge is shared differently around the world.
 5.1 In other parts of the world, knowledge is shared differently.

6. 01:14 🤔 Thinking outside the box can lead to creative solutions, even in difficult situations.
 6.1 Using a comma makes writing easier.

7. 01:18 💻 AutoHotkey automates tasks and creates custom shortcuts.
 7.1 AutoHotkey can automate tasks and create custom shortcuts.

8. 01:21 💻 Use regex to simplify code and make it more readable.
 8.1 Use regular expressions to do pattern matching to simplify your code and make it easier to read.


Summary for https://youtu.be/knf-BL2o2xY by www.eightify.app

If you're new to AutoHotkey and want to learn amazing tips & tricks Check out this Amazing AutoHotkey Tutorial for Beginners: https://www.youtube.com/watch?v=hZRggm8RkhM