Re: Format function in Delphi

Posted by webmaster Guido

In Reply to: Re: Format function in Delphi posted by robert

: is it possible write floats right aligned?

By default, the Delphi function Format returns strings that are right aligned. Example:
R := 120.7;
S := Format('%10.2f', [R]);

For left alignment you have to add a - character after the %. Example:
S := Format('%-10.2f', [R]);

...as explained in my previous message ;)