$str.printf

Returns a formatted string in a C sprintf-like fashion.
Usage
$str.printf(<format>[,<parameter>[...]]);
Description
This function acts like the C sprintf(): it returns a string formatted by following the specification in <format> and by using the following corresponding variadic parameters. Since the percent sign is used as variable prefix in KVIrc, this function uses the question mark '?' instead.
The <format> string can contain the following escape sequences:

?sThe next parameter is evaluated as a string and substituted in place of ?s
?dThe next parameter is evaluated as a signed integer and substituted in place of ?d
?iSame as ?d
?uThe next parameter is evaluated as an unsigned signed integer and substituted in place of ?d
?xThe next parameter is evaluated as an unsigned integer and its hexadecimal rappresentation     is substituted in place of ?x
?hSame as ?x
?XSame as ?x but uppercase hexadecimal digits are used
?HSame as ?X
??A literal question mark
?[.N]fThe next parameter is evaluated as a real floating point value     and its rappresentation substituted in place of ?f. The optional [.N] modifier,     where N is an unsigned integer, rappresents the desired precision.
?[.N]eThe next parameter is evaluated as a real floating point value     and its scientific rappresentation substituted in place of ?e. The optional [.N] modifier,     where N is an unsigned integer, rappresents the desired precision.
?[.N]ESame as ?e but an uppercase E is used as the exponent prefix
Syntax Specification
<string> $str.printf(<format:string>[,<parameter:variant>[...]]);
Examples

    %val = $(1.0 / 3.0);
    $str.printf("1/3 with a precision of 3 digits is ?.3f, while in scientific notation it's ?e",%val,%val)


Index, Functions
KVIrc 3.9.99 Documentation
Generated by root at Wed Oct 17 19:34:06 2007