LLVM 20.0.0git
|
Implementation of format_provider<T> for floating point types. More...
#include "llvm/Support/FormatProviders.h"
Static Public Member Functions | |
static void | format (const T &V, llvm::raw_ostream &Stream, StringRef Style) |
Additional Inherited Members | |
Static Protected Member Functions inherited from llvm::support::detail::HelperFunctions | |
static std::optional< size_t > | parseNumericPrecision (StringRef Str) |
static std::optional< HexPrintStyle > | consumeHexStyle (StringRef &Str) |
static size_t | consumeNumHexDigits (StringRef &Str, HexPrintStyle Style, size_t Default) |
Implementation of format_provider<T> for floating point types.
The options string of a floating point type has the format:
float_options :: [style][precision] style :: precision :: <non-negative integer> 0-99
| P / p | Percentage | 0.05 | 5.00% | | F / f | Fixed point | 1.0 | 1.00 | | E | Exponential with E | 100000 | 1.0E+05 | | e | Exponential with e | 100000 | 1.0e+05 |
The default precision is 6 for exponential (E / e) and 2 for everything else.
Definition at line 302 of file FormatProviders.h.
|
inlinestatic |
Definition at line 305 of file FormatProviders.h.
References llvm::Exponent, llvm::ExponentUpper, llvm::Fixed, llvm::getDefaultPrecision(), llvm::Percent, and llvm::write_double().