Parse a format specifier into its constituent flags and values. Syntax follows the traditional printf() approach, as follows:
[flags][width][.precision]type
Where 'type' is one of:
s : string format c : character format d : signed format u : unsigned format x : hexadecimal format X : uppercase hexadecimal format e : scientific notation f : floating point format g : 'e' or 'f', based upon width
Note that there are no variants on the format types ~ long, int, short, and byte differences are all handled internally.
The 'flags' supported:
space : prefix negative integer with one space; pad any type when combined with a width specifier
- : left-align fields padded with spaces + : prefix positive integer with one '+' 0 : prefix integers with zeroes; requires a width specification # : prefix integers with a type specifier @ : Array specifier
The 'width' should be specified for either zero or space padding, and may be used with all formatting types.
A 'precision' can be used to stipulate the number of decimal-places, or a slice of a text string.
Note that the Format package supports array-output in addition to the usual printf() output.
Definition at line 247 of file Styled.d. |