Add %lu & %li as format for int64 (#2421)

This commit is contained in:
Ayrton09
2026-04-09 15:58:35 +02:00
committed by GitHub
parent 337b755f34
commit a3fb4dfe5e
2 changed files with 46 additions and 8 deletions
+15 -1
View File
@@ -224,7 +224,7 @@ native int StringToInt64(const char[] str, int result[2], int nBase=10);
native int IntToString(int num, char[] str, int maxlength);
/**
* Converts a 64-bit integer to a string.
* Converts a 64-bit integer in the legacy 2-cell representation to a string.
*
* @param num Array containing the upper and lower
* 32-bits of a 64-bit integer.
@@ -235,6 +235,20 @@ native int IntToString(int num, char[] str, int maxlength);
*/
native int Int64ToString(const int num[2], char[] str, int maxlength);
/**
* Converts an int64 value to a string.
*
* @param num int64 value to convert.
* @param str Buffer to store string in.
* @param maxlength Maximum length of string buffer.
* @return Number of characters written to the buffer,
* not including the null terminator.
*/
stock int Int64ToStringEx(int64 num, char[] str, int maxlength)
{
return Format(str, maxlength, "%li", num);
}
/**
* Converts a string to a floating point number.
*