Skip to content

Instantly share code, notes, and snippets.

@McTwist
McTwist / num2str.cs
Created August 16, 2017 00:10
Correctly converts a number in TorqueScript to a string
// Converts a number to a string correctly
function num2str(%num)
{
if (mAbs(%num) < 1000000)
return "" @ %num;
if (%num < 0)
{
%neg = true;
%num = -%num;
}