4DOS Help Topic: @FORMAT
@FORMAT[[-][[0]x][.y],string]: Reformats a string, truncating it or padding
it with spaces as necessary. If you use the minus [-], the string is
left-justified; otherwise, it is right-justified. The x value is the
minimum number of characters in the result. The y value is the maximum
number of characters in the result. You can combine the options as
necessary. For example:
"%@format[12,JPSoftware]" returns " JPSoftware"
"%@format[.3,JPSoftware]" returns "JPS"
@FORMAT will add leading or trailing spaces if necessary to pad the result
to the minimum width specified by x. If a leading zero is used before x,
the padding will be with 0's instead, for example:
"%@format[4,5]" returns " 5"
"%@format[04,5]" returns "0005"
"%@format[-04,5]" returns "5000"
See also the @COMMA function, which can make numeric values easier to read
by inserting thousands separators.
|
|