s$ = FormatStr(fmt$, ...)
printfspecification. Here is a list of all tokens that are currently supported:
%ebut in upper case exponential notation
%fformat (whichever is more compact)
%gbut uses upper case if exponential notation is used
You can also specify a width field before the token to limit the number of
characters that the specific token should add to the string. For example,
if you use the token
%.6x, the hexadecimal number generated by this function
will always have 6 digits.
As the percent sign is used for tokens by this function, you need to escape
it if you just want to append a percent sign to the string. In that case simply
use a double percent sign (
a = 128 s$ = FormatStr("The number " .. a .. " is $%x in hexadecimal notation", a)The code above converts the number 128 to hexadecimal notation.
a = 255 s$ = FormatStr("The number " .. a .. " is $%.6x in RGB notation", a)The code above converts the number 255 into a 6 digit hexadecimal value which is often used to specify RGB colors.