Converts and format a variable number of args as is specified by format. printf writes the formatted string to standard output.
args
format
printf
See the module documentation for the available format strings.
The format string to use
Rest
The arguments to format
import { printf } from "@std/fmt/printf";printf("%d", 9); // Prints "9"printf("%o", 9); // Prints "11"printf("%f", 4); // Prints "4.000000"printf("%.3f", 0.9999); // Prints "1.000" Copy
import { printf } from "@std/fmt/printf";printf("%d", 9); // Prints "9"printf("%o", 9); // Prints "11"printf("%f", 4); // Prints "4.000000"printf("%.3f", 0.9999); // Prints "1.000"
Converts and format a variable number of
argsas is specified byformat.printfwrites the formatted string to standard output.See the module documentation for the available format strings.