Just a quick note as I use this function in various scripts. This adds the 1000th separator comma:

    	FormatAddCommas(val) {
    		Result:=val
    		StringLen, OutputVar, Result
    		NumLoop := (OutputVar // 3)
    		DNum = 3
    		Loop, % (NumLoop+1)
    		{
    		   StringRight,Digit,Result,%DNum%
    		   StringReplace, Result, Result, %Digit%,`,%Digit%
    		   DNum += 4
    		}
    		StringLen, OutputVar, Result
    		Loop, %OutputVar%
    		{
    			FirstChar:=Substr(Result, 1, 1)
    			IfEqual, FirstChar, `,
    			{
    				Result:=Substr(Result, 2)
    			} else {
    				break
    			}
    		}
    		Return Result
    	}
Use as per usual:
      ValueWithCommas:=FormatAddCommas(NumberWithoutCommas)


One taken from the AutoHotkey forums:
	AddCommas(val)
	{
	  val:= RegExReplace(val, "(\d)(?=(?:\d{3})+(?:\.|$))", "$1,")
	  Return val
 	}

Another not tested:
	AddCommas(val)
	{
	  val:= RegExReplace(val, "(?(?

And finally PhiLho's:
CommaAdd(num) {

  VarSetCapacity(fNum,32)
  DllCall("GetNumberFormat",UInt,0x0409,UInt,0,Str,Num,UInt,0,Str,fNum,Int,32)
  return SubStr(fNum,1,StrLen(fNum) - 3)

}