ThousandsSep()

作者: infogulch 最近更新时间: 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=",")

关于函数的参数和返回值, 请参阅其源码.

备注

关于此函数(集)的更新细节和注意事项, 请参见 AutoHotkey 论坛: http://www.autohotkey.com/forum/topic54149.html

许可

此函数(集)是基于 infogulch`s license 许可的开源项目. 想了解许可详情, 请参见 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)