to: twos
还有帮助如下
A width specifier sets the minimum field width for a conversion.
If the resulting string is shorter than the minimum field width,
it is padded with blanks to increase the field width. The default
~~~~~~
is to right-justify the result by adding blanks in front of the value,
~~~~~~
but if the format specifier contains a left-justification indicator
(a "-" character preceding the width specifier), the result is
left-justified by adding blanks after the value.
~~~~~~
其实Delphi中的Format做不到这点,不如C的sprintf好用。
ugvanxk的FormatFloat('000000',n) 是正确有效地
还有一种好玩的实现方法
s: string
s := IntToHex(StrToInt('$'+IntToStr
),6);