Code: Select all
S1000(N) { ; Separate 1000's in N, by SKAN on D47G/D47I @ tiny.cc/s1000
Return ( N := StrSplit((N<0 ? "-." : ".") . N, ".") ).Count() ? N.1
. Trim( Format("{}{},{}{}{},{}{}{},{}{}{},{}{}{},{}{}{},{}{}{}." . N.3
, StrSplit( Format("{:20}", Format("{:d}",N.2)))* ), " .,-" ) : 0
}
S1000_DE(N) { ; Separate 1000's in N, by SKAN on D47G/D47I @ tiny.cc/s1000
Return ( N := StrSplit((N<0 ? "-," : ",") . StrReplace(N, ".", ","), ",") ).Count() ? N.1
. Trim( Format("{}{}.{}{}{}.{}{}{}.{}{}{}.{}{}{}.{}{}{}.{}{}{}," . N.3
, StrSplit( Format("{:20}", Format("{:d}",N.2)))* ), " .,-" ) : 0
}
S1000_IN(N) { ; Separate 1000's in N, by SKAN on D47G/D47I @ tiny.cc/s1000
Return ( N := StrSplit((N<0 ? "-." : ".") . N, ".") ).Count() ? N.1
. Trim( Format("{},{}{},{}{},{}{},{}{},{}{},{}{},{}{},{}{},{}{}{}." . N.3
, StrSplit( Format("{:20}", Format("{:d}",N.2)))* ), " .,-" ) : 0
}
#NoEnv
#Warn
#SingleInstance, Force
MsgBox % S1000(-0)
MsgBox % S1000(-.5)
MsgBox % S1000(1000)
MsgBox % S1000(-123456.789)
MsgBox % S1000(2**63-1)