Author: infogulch Last Modified: 20100304
Here is a simple one-liner regex/function that add thousands separators to the correct spots in any decimal number with no loops, no recursion, and no callouts.
ThousandsSep(x, s=",")
For the functions's parameters and return value, please see it's source code.
The initial given function by Tuncay is superceded by the simple one from Lexikos. But I decided not to give any License, the function is too simple for that.
For update's details and remarks related to the functions, please see the AutoHotkey Forum: http://www.autohotkey.com/forum/viewtopic.php?p=320069#320069
For update's details and remarks related to the functions, please see the AutoHotkey Forum: http://www.autohotkey.com/forum/topic54149.html
The functions is an open source item under the infogulch`s license license.
For details, please see infogulch-license.txt
; #Include ThousandsSep.ahk #NoEnv SendMode Input SetWorkingDir %A_ScriptDir% MsgBox % ThousandsSep(1) . "`n" ThousandsSep(12) . "`n" ThousandsSep(1234) . "`n" ThousandsSep(1234567890) . "`n`n" ThousandsSep(1.1) . "`n" ThousandsSep(12.12) . "`n" ThousandsSep(123.123) . "`n" ThousandsSep(1234.1234) . "`n" ThousandsSep(1234567890.1234567890)