summaryrefslogtreecommitdiff
path: root/src/strings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings.cpp')
-rw-r--r--src/strings.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/strings.cpp b/src/strings.cpp
index d8522be25..6e9665ad9 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -267,6 +267,10 @@ static char *FormatNoCommaNumber(char *buff, int64 number, const char *last)
return buff;
}
+static char *FormatHexNumber(char *buff, int64 number, const char *last)
+{
+ return buff + snprintf(buff, last - buff, "0x%x", (uint32)number);
+}
static char *FormatYmdString(char *buff, Date date, const char* last)
{
@@ -815,6 +819,10 @@ static char* FormatString(char* buff, const char* str, const int64* argv, uint c
buff = FormatNoCommaNumber(buff, GetInt64(&argv), last);
break;
+ case SCC_HEX: // {HEX}
+ buff = FormatHexNumber(buff, GetInt64(&argv), last);
+ break;
+
case SCC_CURRENCY: // {CURRENCY}
buff = FormatGenericCurrency(buff, _currency, GetInt64(&argv), false, last);
break;