// This function adds commas every 3 digits for outputs like 12,345,678
function ToThousands ( num )
{
num = num.tostring();
local last = num.find(".") - 1;
local chk = last % 3;
local decimaltrig = false;
local output = "";
foreach ( idx, digit in num )
{
output += digit.tochar();
if ( digit == 44 ) decimaltrig = true;
if ( !decimaltrig && idx < last && idx % 3 == chk ) output += ",";
}
return output;
}
This returns numbers in the following format:
1,000,000
1,234
542
189,23
Floats now work.