[#BloombergLP-bdldfp-DecimalUtil-round-09f] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalUtil.adoc[DecimalUtil]::round :relfileprefix: ../../../ :mrdocs: Return `x` rounded to the specified number of decimal places. == Synopsis Declared in `<bdldfp_decimalutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] round( xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] x, unsigned int precision); ---- == Description Return the specified `x` value rounded to the specified `precision` decimal places. Round halfway cases away from zero, regardless of the current decimal floating point rounding mode. If `x` is integral, positive zero, negative zero, NaN, or infinity then return `x` itself. Examples: `round(3.14159, 3)` ==> 3.142 == Return Value `x` rounded to the specified number of decimal places == Parameters [cols="1,4"] |=== | Name| Description | *x* | value to round | *precision* | number of decimal places to round to |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#