summaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-04-09 20:26:14 +0000
committerfrosch <frosch@openttd.org>2011-04-09 20:26:14 +0000
commit70f9a6747e6e9cd5a292f36b7f872f3ae3055906 (patch)
tree693a761f85fdf282b5291e65a1716b11d146a698 /src/table
parent2c8b7a980f446651747e01e27152f91967a30b8c (diff)
downloadopenttd-70f9a6747e6e9cd5a292f36b7f872f3ae3055906.tar.xz
(svn r22304) -Add: {DECIMAL} string code to print decimal fractions.
Diffstat (limited to 'src/table')
-rw-r--r--src/table/control_codes.h1
-rw-r--r--src/table/strgen_tables.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/table/control_codes.h b/src/table/control_codes.h
index ccebcc864..73d4a2b91 100644
--- a/src/table/control_codes.h
+++ b/src/table/control_codes.h
@@ -72,6 +72,7 @@ enum StringControlCode {
SCC_STRING,
SCC_COMMA,
+ SCC_DECIMAL,
SCC_NUM,
SCC_ZEROFILL_NUM,
SCC_HEX,
diff --git a/src/table/strgen_tables.h b/src/table/strgen_tables.h
index ecc3bbedd..9979b10f3 100644
--- a/src/table/strgen_tables.h
+++ b/src/table/strgen_tables.h
@@ -92,6 +92,7 @@ static const CmdStruct _cmd_structs[] = {
/* Numbers */
{"COMMA", EmitSingleChar, SCC_COMMA, 1, C_NONE}, // Number with comma
+ {"DECIMAL", EmitSingleChar, SCC_DECIMAL, 2, C_NONE}, // Number with comma and fractional part. Second parameter is number of fractional digits, first parameter is number times 10**(second parameter).
{"NUM", EmitSingleChar, SCC_NUM, 1, C_NONE}, // Signed number
{"ZEROFILL_NUM", EmitSingleChar, SCC_ZEROFILL_NUM, 2, C_NONE}, // Unsigned number with zero fill, e.g. "02". First parameter is number, second minimum length
{"BYTES", EmitSingleChar, SCC_BYTES, 1, C_NONE}, // Unsigned number with "bytes", i.e. "1.02 MiB or 123 KiB"