mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-23 05:11:02 +02:00
* Add boolean %b format specifier
This commit is contained in:
parent
d9fb288552
commit
2854f08daa
@ -263,6 +263,21 @@ begin
|
|||||||
DumpFormat(FCHar);
|
DumpFormat(FCHar);
|
||||||
{$endif}
|
{$endif}
|
||||||
Case FChar of
|
Case FChar of
|
||||||
|
'B' : begin
|
||||||
|
if Checkarg(vtInteger,False) then
|
||||||
|
ToAdd:=BoolToStr((Args[Doarg].VInteger<>0),True)
|
||||||
|
else if Checkarg(vtInt64,False) then
|
||||||
|
ToAdd:=BoolToStr((Args[Doarg].VInt64^<>0),True)
|
||||||
|
else if Checkarg(vtBoolean,True) then
|
||||||
|
ToAdd:=BoolToStr(Args[Doarg].VBoolean,True);
|
||||||
|
Index:=Length(ToAdd);
|
||||||
|
// Top off
|
||||||
|
If (Prec<>-1) and (Index>Prec) then
|
||||||
|
begin
|
||||||
|
Index:=Prec;
|
||||||
|
ToAdd:=Copy(ToAdd,1,Index);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
'D' : begin
|
'D' : begin
|
||||||
if Checkarg(vtinteger,false) then
|
if Checkarg(vtinteger,false) then
|
||||||
Str(Args[Doarg].VInteger,ToAdd)
|
Str(Args[Doarg].VInteger,ToAdd)
|
||||||
|
Loading…
Reference in New Issue
Block a user