# DECFLOAT ROUNDING MODE field (DEF_DECFLOAT_ROUND_MODE DECP value)

The DEF_DECFLOAT_ROUND_MODE DECP value specifies the system default action that is to be used for rounding decimal floating point values.

Acceptable values: | ROUND_CEILING, ROUND_DOWN, ROUND_FLOOR, ROUND_HALF_DOWN, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_UP |
---|---|

Default: | ROUND_HALF_EVEN |

Update: | not recommended |

dsnhdecp: |
DEF_DECFLOAT_ROUND_MODE |

- ROUND_CEILING
- Rounds towards +infinity. If all of the discarded digits are zero or if the sign is negative, Db2 removes the discarded digits and the rest of the result remains the same. In all other cases, Db2 increments the result coefficient by 1.
- ROUND_DOWN
- Rounds towards 0. Db2 ignores the discarded digits.
- ROUND_FLOOR
- Rounds towards -infinity. If all of the discarded digits are zero or if the sign is positive, Db2 removes the discarded digits and the rest of the result remains the same. In all other cases, Db2 increments the result coefficient by 1.
- ROUND_HALF_DOWN
- Rounds to the nearest number. If the discarded digits are greater than 0.5 of the value of a one in the next left position, Db2 increments the result coefficient by 1. If the discarded digits are equal or less than 0.5, Db2 ignores the discarded digits.
- ROUND_HALF_EVEN
- Rounds to the nearest number. If the discarded digits are greater than 0.5, the value of a one in the next left position, Db2 increments the result coefficient by 1. If the discarded digits are less than 0.5, Db2 ignores the discarded digits. If the discarded digits are 0.5 and the rightmost digit is even, Db2 does not alter the result coefficient. If the discarded digits are 0.5 and the rightmost digit is odd, Db2 increments the result coefficient by 1 to make it an even digit.
- ROUND_HALF_UP
- Rounds to the nearest number. If the discarded digits are greater than or equal to 0.5 of the value of a one in the next left position, Db2 increments the result coefficient by 1. In all other cases, Db2 ignores the discarded digits.
- ROUND_UP
- Rounds away from 0. If all of the discarded digits are zero, Db2 removes the discarded digits and the rest of the result remains the same. In all other cases, Db2 increments the result coefficient by 1.