BloombergLP::bdldfp::DecimalFormatConfig::DecimalFormatConfig

Constructors

Synopses

Declared in <bdldfp_decimalformatconfig.h>

Create an object of this class having the default attribute values.

DecimalFormatConfig();
» more...

Create an object of this class having the specified precision to control how many digits are written after a decimal point.

explicit
DecimalFormatConfig(
    int precision,
    Style style = e_NATURAL,
    Sign sign = e_NEGATIVE_ONLY,
    char const* infinity = "inf",
    char const* nan = "nan",
    char const* snan = "snan",
    char point = '.',
    char exponent = 'e',
    bool showpoint = false,
    int expWidth = 2);
» more...

Parameters

NameDescription
precisionnumber of digits written after the decimal point
stylehow the decimal number is written
signhow the sign is output
infinitystring used to output an infinity value
nanstring used to output a NaN value
snanstring used to output a signaling NaN value
pointcharacter used for decimal points
exponentcharacter used for the exponent
showpointwhether a decimal point is always displayed
expWidthminimum number of digits used to write the exponent