formatInt() takes an int64 value, which means it doesn't properly handle uint64 values greater than INT64_MAX. Would it be possible to add something like the below to the script string?
+static string formatUInt(asQWORD value, const string &options, asUINT width)
+{
+ bool leftJustify = options.find("l") != string::npos;
+ bool padWithZero = options.find("0") != string::npos;
+ bool alwaysSign = options.find("+") != string::npos;
+ bool spaceOnSign = options.find(" ") != string::npos;
+ bool hexSmall = options.find("h") != string::npos;
+ bool hexLarge = options.find("H") != string::npos;
+
+ string fmt = "%";
+ if( leftJustify ) fmt += "-";
+ if( alwaysSign ) fmt += "+";
+ if( spaceOnSign ) fmt += " ";
+ if( padWithZero ) fmt += "0";
+
+#ifdef _WIN32
+ fmt += "*I64u";
+#else
+#ifdef _LP64
+ fmt += "*l";
+#else
+ fmt += "*ll";
+#endif
+#endif
+
+ if( hexSmall ) fmt += "x";
+ else if( hexLarge ) fmt += "X";
+ else fmt += "u";
+
+ string buf;
+ buf.resize(width+30);
+#if _MSC_VER >= 1400 && !defined(__S3E__)
+ // MSVC 8.0 / 2005 or newer
+ sprintf_s(&buf[0], buf.size(), fmt.c_str(), width, value);
+#else
+ sprintf(&buf[0], fmt.c_str(), width, value);
+#endif
+ buf.resize(strlen(&buf[0]));
+
+ return buf;
+}
+ r = engine->RegisterGlobalFunction("string formatInt(uint64 val, const string &in options, uint width = 0)", asFUNCTION(formatUInt), asCALL_CDECL); assert(r >= 0);