[#BloombergLP-bdldfp-DecimalFormatConfig-2constructor-09] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalFormatConfig.adoc[DecimalFormatConfig]::DecimalFormatConfig :relfileprefix: ../../../ :mrdocs: Create an object of this class having the specified `precision` to control how many digits are written after a decimal point. == Synopsis Declared in `<bdldfp_decimalformatconfig.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit DecimalFormatConfig( int precision, xref:BloombergLP/bdldfp/DecimalFormatConfig/Style-06.adoc[Style] style = e_NATURAL, xref:BloombergLP/bdldfp/DecimalFormatConfig/Sign-0a.adoc[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); ---- == Description The behavior is undefined unless `precision >= ‐1`. Optionally specify `style` to control how the number is written. If it is not specified, `e_NATURAL` is used. Optionally specify `sign` to control how the sign is output. If is not specified, `e_NEGATIVE_ONLY` is used. Optionally specify `infinity` as a string to output infinity value. If it is not specified, "inf" is used. Optionally specify `nan` as a string to output NaN value. If it is not specified, "nan" is used. Optionally specify `snan` as a string to output signaling NaN value. If it is not specified, "snan" is used. The behavior is undefined unless the pointers to `infinity`, `nan` and `snan` remain valid for the lifetime of this object. Optionally specify `point` as the character to use for decimal points. If it is not specified, `.` is used. Optionally specify `exponent` as the character to use for exponent. If it is not specified, `e` is used. Optionally specify `showpoint` to force a decimal point to always be written. Optionally specify `expWidth` to force at least that many digits to be written for an exponent, up to the number of digits in the largest supported exponent. If it is not specified, 2 is used. The behavior is undefined unless `expWidth` is 1, 2, 3, or 4. See the section for information on the class attributes. == Parameters [cols="1,4"] |=== | Name| Description | *precision* | number of digits written after the decimal point | *style* | how the decimal number is written | *sign* | how the sign is output | *infinity* | string used to output an infinity value | *nan* | string used to output a NaN value | *snan* | string used to output a signaling NaN value | *point* | character used for decimal points | *exponent* | character used for the exponent | *showpoint* | whether a decimal point is always displayed | *expWidth* | minimum number of digits used to write the exponent |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#