# BigDecimal保留小数位

BigDecimal.setScale()方法用于格式化小数点

• ROUND_CEILING

Rounding mode to round towards positive infinity.

• ROUND_DOWN

Rounding mode to round towards zero.

• ROUND_FLOOR

Rounding mode to round towards negative infinity.

• ROUND_HALF_DOWN

Rounding mode to round towards “nearest neighbor” unless both neighbors are equidistant, in which case round down.

• ROUND_HALF_EVEN

Rounding mode to round towards the “nearest neighbor” unless both neighbors are equidistant, in which case, round towards the even neighbor.

• ROUND_HALF_UP

Rounding mode to round towards “nearest neighbor” unless both neighbors are equidistant, in which case round up.

• ROUND_UNNECESSARY

Rounding mode to assert that the requested operation has an exact result, hence no rounding is necessary.

• ROUND_UP

Rounding mode to round away from zero.