forked from external/yambar
tag: for now, always use 2 decimals for floats
In the future, we’ll want to add a way to specify the number of decimals, as part of the formatter.
This commit is contained in:
parent
8a8a40bfb5
commit
a8994b9268
1 changed files with 1 additions and 1 deletions
2
tag.c
2
tag.c
|
@ -583,7 +583,7 @@ tags_expand_template(const char *template, const struct tag_set *tags)
|
|||
|
||||
char str[24];
|
||||
if (tag->type(tag) == TAG_TYPE_FLOAT)
|
||||
snprintf(str, sizeof(str), "%f", tag->as_float(tag) / (double)divider);
|
||||
snprintf(str, sizeof(str), "%.2f", tag->as_float(tag) / (double)divider);
|
||||
else
|
||||
snprintf(str, sizeof(str), "%lu", tag->as_int(tag) / divider);
|
||||
sbuf_append(&formatted, str);
|
||||
|
|
Loading…
Add table
Reference in a new issue