[PATCH] Fixed the display of real values with the %t format.

Add a calculation to compute the required width for real values
when displayed with the %t formet.
This commit is contained in:
Cary R 2007-08-06 19:28:54 -07:00 committed by Stephen Williams
parent 06c15862e8
commit dd6a441312
1 changed files with 3 additions and 2 deletions

View File

@ -309,8 +309,9 @@ static void format_time_real(unsigned mcd, int fsize,
/* The timeformat_info.prec is the number of digits after the
decimal point, no matter what the units. */
my_mcd_printf(mcd, "%0.*f%s", timeformat_info.prec, value,
timeformat_info.suff);
my_mcd_printf(mcd, "%*.*f%s", timeformat_info.width -
strlen(timeformat_info.suff), timeformat_info.prec,
value, timeformat_info.suff);
}