mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-13 12:34:26 +08:00
avprobe: improve formatting
Do not use decimals if not needed.
This commit is contained in:
@@ -90,8 +90,9 @@ static char *value_string(char *buf, int buf_size, double val, const char *unit)
|
|||||||
val /= pow(10, index * 3);
|
val /= pow(10, index * 3);
|
||||||
prefix_string = decimal_unit_prefixes[index];
|
prefix_string = decimal_unit_prefixes[index];
|
||||||
}
|
}
|
||||||
|
snprintf(buf, buf_size, "%.*f%s%s",
|
||||||
snprintf(buf, buf_size, "%.3f %s%s", val, prefix_string,
|
index ? 3 : 0, val,
|
||||||
|
prefix_string,
|
||||||
show_value_unit ? unit : "");
|
show_value_unit ? unit : "");
|
||||||
} else {
|
} else {
|
||||||
snprintf(buf, buf_size, "%f%s", val, show_value_unit ? unit : "");
|
snprintf(buf, buf_size, "%f%s", val, show_value_unit ? unit : "");
|
||||||
|
Reference in New Issue
Block a user