[#BloombergLP-bdldfp-DecimalUtil-trunc-0ab]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalUtil.adoc[DecimalUtil]::trunc
:relfileprefix: ../../../
:mrdocs:

Return the specified `x` value truncated to the specified `precision` decimal places&period; Round towards zero, regardless of the current decimal floating point rounding mode&period; If precision of `x` is less than or equal the `precision` or `x` is positive zero, negative zero, NaN, or infinity then return `x` itself&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32]
trunc(
    xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] x,
    unsigned int precision);
----

== Description

Examples&colon; `trunc(3&period;14159, 3)` &equals;&equals;&gt; 3&period;141


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