[#BloombergLP-bdldfp-DecimalImpUtil-quantize-07]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalImpUtil.adoc[DecimalImpUtil]::quantize
:relfileprefix: ../../../
:mrdocs:

Return `value` quantized to the specified `exponent`&period;

== Synopsis

Declared in `&lt;bdldfp&lowbar;decimalimputil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType32.adoc[DecimalImpUtil::ValueType32]
quantize(
    xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType32.adoc[ValueType32] value,
    int exponent);
----

== Description

Return a number equal to the specified `value` (except for possible rounding) having the specified `exponent`&period; Rounding may occur when `exponent` is greater than the quantum of `value`&period; E&period;g&period;, `quantize(147e&hyphen;2&lowbar;d32, &hyphen;1)` yields `15e&hyphen;1&lowbar;d32`&period; In the opposite direction, if `exponent` is sufficiently less than the quantum of `value`, it may not be possible to construct the requested result, and if so, `NaN` is returned&period; E&period;g&period;, `quantize(1234567e0&lowbar;d32, &hyphen;1)` returns `NaN`&period; Behavior is undefined unless the `exponent` satisfies the following conditions &ast; for `Decimal32` type&colon; `&hyphen;101 &lt;&equals; exponent &lt;&equals; 90` &ast; for `Decimal64` type&colon; `&hyphen;398 &lt;&equals; exponent &lt;&equals; 369` &ast; for `Decimal128` type&colon; `&hyphen;6176 &lt;&equals; exponent &lt;&equals; 6111`

== Return Value

`value` quantized to the specified `exponent`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *value*
| value to quantize
| *exponent*
| target quantum exponent
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
