BloombergLP::bdldfp::DecimalUtil::round

round overloads

Synopses

Declared in <bdldfp_decimalutil.h>

Same as the related overload above for round.

static
Decimal128
round(Decimal128 x);
» more...

Return the integral value nearest to the specified x.

static
Decimal32
round(Decimal32 x);
» more...

Same as the related overload above for round.

static
Decimal64
round(Decimal64 x);
» more...

Same as the related overload above for round.

static
Decimal128
round(
    Decimal128 x,
    unsigned int precision);
» more...

Return x rounded to the specified number of decimal places.

static
Decimal32
round(
    Decimal32 x,
    unsigned int precision);
» more...

Same as the related overload above for round.

static
Decimal64
round(
    Decimal64 x,
    unsigned int precision);
» more...

Return Value

  • integral value nearest to x
  • x rounded to the specified number of decimal places

Parameters

NameDescription
xvalue to round to nearest integral decimal
precisionnumber of decimal places to round to