Percent: add option --percent-width

This commit is contained in:
李通洲
2025-07-30 15:06:16 +08:00
parent ce554dbdd0
commit aa0bbd5aee
5 changed files with 23 additions and 1 deletions
+1 -1
View File
@@ -186,7 +186,7 @@ void ffPercentAppendNum(FFstrbuf* buffer, double percent, FFPercentageModuleConf
ffStrbufAppendF(buffer, "\e[%sm", colorGreen);
}
}
ffStrbufAppendF(buffer, "%.*f%s%%", options->percentNdigits, percent,
ffStrbufAppendF(buffer, "%*.*f%s%%", options->percentWidth, options->percentNdigits, percent,
options->percentSpaceBeforeUnit == FF_SPACE_BEFORE_UNIT_ALWAYS ? " " : "");
if (colored && !options->pipe)