format

Supports format specifications via an array, where format follows the notation given below:

type width prefix

Type is one of [d, g, u, b, x, o] or uppercase equivalent, and dictates the conversion radix or other semantics.

Width is optional and indicates a minimum width for zero-padding, while the optional prefix is one of ['#', ' ', '+'] and indicates what variety of prefix should be placed in the output. e.g.

"d"     => integer
"u"     => unsigned
"o"     => octal
"b"     => binary
"x"     => hexadecimal
"X"     => hexadecimal uppercase

"d+"    => integer prefixed with "+"
"b#"    => binary prefixed with "0b"
"x#"    => hexadecimal prefixed with "0x"
"X#"    => hexadecimal prefixed with "0X"

"d8"    => decimal padded to 8 places as required
"b8"    => binary padded to 8 places as required
"b8#"   => binary padded to 8 places and prefixed with "0b"

Note that the specified width is exclusive of the prefix, though the width padding will be shrunk as necessary in order to ensure a requested prefix can be inserted into the provided output.

const(T)[]
format
(
T
N
)
(
T[] dst
,
N i
,
in T[] fmt = null
)

Meta