# std.io.Writer.printValue: rework logic · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/7e2a26c0c441a902968726442114e3590820433b)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 7e2a26c0c441a902968726442114e3590820433b

Requested commit: 7e2a26c0c441a902968726442114e3590820433b

Commit: 7e2a26c0c441a902968726442114e3590820433b

Tree: 90035e47e0208afa7d1bcd3484e30d22d2a24f4e

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.io.Writer.printValue: rework logic

Alignment and fill options only apply to numbers.

Rework the implementation to mainly branch on the format string rather
than the type information. This is more straightforward to maintain and
more straightforward for comptime evaluation.

Enums support being printed as decimal, hexadecimal, octal, and binary.

`formatInteger` is another possible format method that is
unconditionally called when the value type is struct and one of the
integer-printing format specifiers are used.

```

## Parents

- [5378fdb153bc76990105e3640e7725e434e8cdee](https://git.cafe/gitcafe/zig/commit/5378fdb153bc76990105e3640e7725e434e8cdee?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/7e2a26c0c441a902968726442114e3590820433b?format=markdown)
