|
fiber
|
Formats an floating point for further printing use. More...
#include <OStream.hpp>
Public Types | |
| using | value_type = float |
Public Member Functions | |
| constexpr | FormatFloat ()=default |
| constexpr | FormatFloat (const FormatFloat &)=default |
| constexpr FormatFloat & | operator= (const FormatFloat &)=default |
| template<typename Float, typename std::enable_if< std::is_floating_point< Float >::value, int >::type = 0> | |
| constexpr | FormatFloat (Float value) |
| constexpr FormatFloat & | use_thousands (bool b=true) |
| enables thousand characters | |
| constexpr FormatFloat & | thousands (char c=',') |
| enable thousands seperator | |
| constexpr FormatFloat & | comma (char c) |
| sets the comma value (default: '.') | |
| constexpr FormatFloat & | fsign (bool b=true) |
| forces the printing of the sign, even if it is positive | |
| constexpr FormatFloat & | mwidth (int mw) |
| sets the minimum width the the number should occupy in text - the rest will be filled with padding/fill characters | |
| constexpr FormatFloat & | fill (char c) |
| sets the padding/fill character | |
| constexpr FormatFloat & | pad_sign (bool b=true) |
| enables padding for the sign character | |
| constexpr FormatFloat & | right () |
| flushright: sets the alignment to right - padding will be applied to the left | |
| constexpr FormatFloat & | left () |
| flushleft: sets the alignment to left - padding will be applied to the right | |
| constexpr FormatFloat & | center () |
| center: sets the alignment to center - padding will be applied to both sides | |
| constexpr FormatFloat & | sci () |
| formats the number in scientific notation: exponent so that there is always one digit before the comma. | |
| constexpr FormatFloat & | eng () |
| formats the number in engineering notation: exponent in magnitudes of three | |
| constexpr FormatFloat & | full () |
| formats the number so that it is shown in its full length without the use of exponents | |
| constexpr FormatFloat & | decimals (int d) |
| sets the precision, aka. the number of total digits that will be printed before and after the comma | |
| constexpr FormatFloat & | fcomma (bool b=true) |
| force a comma in every print, even if it is not needed to display the number | |
| constexpr FormatFloat & | fdeci (bool b=true) |
| force the printing of all decimals, even if they are zero | |
| constexpr FormatFloat & | fexp (bool b=true) |
| force the printing of the exponent, even if it is zero | |
| constexpr FormatFloat & | fexpsign (bool b=true) |
| force the sign of the exponent, even if it is positive | |
Public Member Functions inherited from fiber::FormatFloatParams | |
| constexpr | FormatFloatParams ()=default |
| constexpr | FormatFloatParams (const FormatFloatParams &)=default |
| constexpr FormatFloatParams & | operator= (const FormatFloatParams &)=default |
| constexpr | FormatFloatParams (const FormatStrParams ¶ms) |
| constexpr FormatFloatParams & | operator= (const FormatStrParams ¶ms) |
| constexpr | FormatFloatParams (const FormatIntParams ¶ms) |
| constexpr FormatFloatParams & | operator= (const FormatIntParams ¶ms) |
Public Member Functions inherited from fiber::FormatIntParams | |
| constexpr | FormatIntParams ()=default |
| constexpr | FormatIntParams (const FormatIntParams &)=default |
| constexpr FormatIntParams & | operator= (const FormatIntParams &)=default |
| constexpr | FormatIntParams (const FormatStrParams ¶ms) |
| constexpr FormatIntParams & | operator= (const FormatStrParams ¶ms) |
Static Public Member Functions | |
| template<typename Float, typename std::enable_if< std::is_floating_point< Float >::value, int >::type = 0> | |
| static constexpr FormatFloat | like (Float value, const FormatFloatParams ¶ms) |
| template<typename Float, typename std::enable_if< std::is_floating_point< Float >::value, int >::type = 0> | |
| static constexpr FormatFloat | like (Float value, const FormatIntParams ¶ms) |
| template<typename Float, typename std::enable_if< std::is_floating_point< Float >::value, int >::type = 0> | |
| static constexpr FormatFloat | like (Float value, const FormatStrParams ¶ms) |
Public Attributes | |
| value_type | _value = 0 |
Public Attributes inherited from fiber::FormatFloatParams | |
| FloatRepresentation | _representation = FloatRepresentation::Engineering |
| char | _comma = '.' |
| unsigned int | _decimals = 3 |
| bool | _force_comma = false |
| bool | _force_decimals = false |
| bool | _force_exponent = false |
| bool | _force_exponent_sign = false |
Public Attributes inherited from fiber::FormatIntParams | |
| bool | _force_sign = false |
| bool | _pad_sign = false |
Public Attributes inherited from fiber::FormatStrParams | |
| AlignmentLRC | _alignment = AlignmentLRC::Right |
| int | _mwidth = 0 |
| char | _fill = ' ' |
Public Attributes inherited from fiber::_FormatUIntParams | |
| char | _thousands_char = ',' |
| bool | _use_thousands = false |
Formats an floating point for further printing use.
| using fiber::FormatFloat::value_type = float |
|
constexprdefault |
|
constexprdefault |
|
inlineexplicitconstexpr |
|
inlineconstexpr |
center: sets the alignment to center - padding will be applied to both sides
|
inlineconstexpr |
sets the comma value (default: '.')
|
inlineconstexpr |
sets the precision, aka. the number of total digits that will be printed before and after the comma
|
inlineconstexpr |
formats the number in engineering notation: exponent in magnitudes of three
|
inlineconstexpr |
force a comma in every print, even if it is not needed to display the number
|
inlineconstexpr |
force the printing of all decimals, even if they are zero
|
inlineconstexpr |
force the printing of the exponent, even if it is zero
|
inlineconstexpr |
force the sign of the exponent, even if it is positive
|
inlineconstexpr |
sets the padding/fill character
|
inlineconstexpr |
forces the printing of the sign, even if it is positive
|
inlineconstexpr |
formats the number so that it is shown in its full length without the use of exponents
|
inlineconstexpr |
flushleft: sets the alignment to left - padding will be applied to the right
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlineconstexpr |
sets the minimum width the the number should occupy in text - the rest will be filled with padding/fill characters
|
constexprdefault |
|
inlineconstexpr |
enables padding for the sign character
|
inlineconstexpr |
flushright: sets the alignment to right - padding will be applied to the left
|
inlineconstexpr |
formats the number in scientific notation: exponent so that there is always one digit before the comma.
|
inlineconstexpr |
enable thousands seperator
| c | the character to be used for thousands seperator (default: ',') |
|
inlineconstexpr |
enables thousand characters
| value_type fiber::FormatFloat::_value = 0 |