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

`trunc` overloads

== Synopses

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

Same as the related overload above for `trunc`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdldfp/Decimal128.adoc[Decimal128]
xref:BloombergLP/bdldfp/DecimalUtil/trunc-0d.adoc[trunc](xref:BloombergLP/bdldfp/Decimal128.adoc[Decimal128] x);
----

[.small]#xref:BloombergLP/bdldfp/DecimalUtil/trunc-0d.adoc[_» more&period;&period;&period;_]#

Return the nearest integral value not greater in magnitude than `x`&period;


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

[.small]#xref:BloombergLP/bdldfp/DecimalUtil/trunc-0af.adoc[_» more&period;&period;&period;_]#

Same as the related overload above for `trunc`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdldfp/Decimal64.adoc[Decimal64]
xref:BloombergLP/bdldfp/DecimalUtil/trunc-01.adoc[trunc](xref:BloombergLP/bdldfp/Decimal64.adoc[Decimal64] x);
----

[.small]#xref:BloombergLP/bdldfp/DecimalUtil/trunc-01.adoc[_» more&period;&period;&period;_]#

Same as the overload taking `Decimal64`&period;


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

[.small]#xref:BloombergLP/bdldfp/DecimalUtil/trunc-00.adoc[_» more&period;&period;&period;_]#

Return `x` truncated to the specified number of decimal places&period;


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

[.small]#xref:BloombergLP/bdldfp/DecimalUtil/trunc-0ab.adoc[_» more&period;&period;&period;_]#

Same as the related overload above for `trunc`&period;


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

[.small]#xref:BloombergLP/bdldfp/DecimalUtil/trunc-09.adoc[_» more&period;&period;&period;_]#

== Return Value

* nearest integral value not greater in magnitude than `x`
* `x` truncated to the specified number of decimal places

== Parameters

[cols="1,4"]
|===
| Name| Description
| *x*
| value to truncate toward zero
| *precision*
| number of decimal places to retain
|===


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