Function printf

  • Converts and format a variable number of args as is specified by format. printf writes the formatted string to standard output.

    See the module documentation for the available format strings.

    Parameters

    • format: string

      The format string to use

    • Rest...args: unknown[]

      The arguments to format

    Returns void

    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"