Add a DECIMAL1 string code, which is DECIMAL with a fixed param of 1.
This commit is contained in:
@@ -5574,6 +5574,7 @@ STR_JUST_CURRENCY_LONG :{CURRENCY_LONG}
|
|||||||
STR_JUST_CARGO_LIST :{CARGO_LIST}
|
STR_JUST_CARGO_LIST :{CARGO_LIST}
|
||||||
STR_JUST_INT :{NUM}
|
STR_JUST_INT :{NUM}
|
||||||
STR_JUST_DECIMAL :{DECIMAL}
|
STR_JUST_DECIMAL :{DECIMAL}
|
||||||
|
STR_JUST_DECIMAL1 :{DECIMAL1}
|
||||||
STR_JUST_DATE_TINY :{DATE_TINY}
|
STR_JUST_DATE_TINY :{DATE_TINY}
|
||||||
STR_JUST_DATE_SHORT :{DATE_SHORT}
|
STR_JUST_DATE_SHORT :{DATE_SHORT}
|
||||||
STR_JUST_DATE_LONG :{DATE_LONG}
|
STR_JUST_DATE_LONG :{DATE_LONG}
|
||||||
|
@@ -1247,6 +1247,12 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case SCC_DECIMAL1: {// {DECIMAL1}
|
||||||
|
int64 number = args->GetInt64(SCC_DECIMAL1);
|
||||||
|
buff = FormatCommaNumber(buff, number, last, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case SCC_NUM: // {NUM}
|
case SCC_NUM: // {NUM}
|
||||||
buff = FormatNoCommaNumber(buff, args->GetInt64(SCC_NUM), last);
|
buff = FormatNoCommaNumber(buff, args->GetInt64(SCC_NUM), last);
|
||||||
break;
|
break;
|
||||||
|
@@ -87,6 +87,7 @@ enum StringControlCode {
|
|||||||
SCC_STRING,
|
SCC_STRING,
|
||||||
SCC_COMMA,
|
SCC_COMMA,
|
||||||
SCC_DECIMAL,
|
SCC_DECIMAL,
|
||||||
|
SCC_DECIMAL1,
|
||||||
SCC_NUM,
|
SCC_NUM,
|
||||||
SCC_ZEROFILL_NUM,
|
SCC_ZEROFILL_NUM,
|
||||||
SCC_HEX,
|
SCC_HEX,
|
||||||
|
@@ -104,6 +104,7 @@ static const CmdStruct _cmd_structs[] = {
|
|||||||
/* Numbers */
|
/* Numbers */
|
||||||
{"COMMA", EmitSingleChar, SCC_COMMA, 1, 0, C_NONE}, // Number with comma
|
{"COMMA", EmitSingleChar, SCC_COMMA, 1, 0, C_NONE}, // Number with comma
|
||||||
{"DECIMAL", EmitSingleChar, SCC_DECIMAL, 2, 0, C_NONE}, // Number with comma and fractional part. Second parameter is number of fractional digits, first parameter is number times 10**(second parameter).
|
{"DECIMAL", EmitSingleChar, SCC_DECIMAL, 2, 0, C_NONE}, // Number with comma and fractional part. Second parameter is number of fractional digits, first parameter is number times 10**(second parameter).
|
||||||
|
{"DECIMAL1", EmitSingleChar, SCC_DECIMAL1, 1, 0, C_NONE}, // Decimal with fixed second parameter of 1
|
||||||
{"NUM", EmitSingleChar, SCC_NUM, 1, 0, C_NONE}, // Signed number
|
{"NUM", EmitSingleChar, SCC_NUM, 1, 0, C_NONE}, // Signed number
|
||||||
{"ZEROFILL_NUM", EmitSingleChar, SCC_ZEROFILL_NUM, 2, 0, C_NONE}, // Unsigned number with zero fill, e.g. "02". First parameter is number, second minimum length
|
{"ZEROFILL_NUM", EmitSingleChar, SCC_ZEROFILL_NUM, 2, 0, C_NONE}, // Unsigned number with zero fill, e.g. "02". First parameter is number, second minimum length
|
||||||
{"BYTES", EmitSingleChar, SCC_BYTES, 1, 0, C_NONE}, // Unsigned number with "bytes", i.e. "1.02 MiB or 123 KiB"
|
{"BYTES", EmitSingleChar, SCC_BYTES, 1, 0, C_NONE}, // Unsigned number with "bytes", i.e. "1.02 MiB or 123 KiB"
|
||||||
|
Reference in New Issue
Block a user