Format a number in "val"; the first prefixLen characters form the prefix (sign, "0x" base prefix, etc) which must be left‐aligned if the alignment is Align::PAD_AFTER_SIGN. Treats Align::DEFAULT as Align::LEFT. Ignores arg.precision, as that has a different meaning for numbers (not "maximum field width")
Synopsis
Declared in <folly/Format.h>
template<class FormatCallback>
void
formatNumber(
StringPiece val,
int prefixLen,
FormatArg& arg,
FormatCallback& cb);
Parameters
Name |
Description |
val |
The number, already rendered as text, to format. |
prefixLen |
The length of the leading prefix (sign, base marker, etc). |
arg |
The format argument describing alignment, padding, and width. |
cb |
The callback that receives the formatted output. |
Created with MrDocs