Skip to content

support formatting durations with format string character rather than a special type #7752

Description

@andrewrk

#7297 introduced a handy way to print time durations:

test "example" {
         std.debug.print("{}", .{std.fmt.duration(1234)}); 
}

This proposal is to delete std.fmt.Duration and std.fmt.duration and make it format character(s) such as {dt}:

test "example" {
         std.debug.print("{dt}", .{1234}); 
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions