H A L F_ U P
Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up. Behaves as for RoundingMode.UP if the discarded fraction is 0.5; otherwise, behaves as for RoundingMode.DOWN. Note that this is the rounding mode commonly taught at school.
Example:
<table class="striped"> <caption>Rounding mode HALF_UP Examples</caption> <thead> <tr style="vertical-align:top"><th scope="col">Input Number</th> <th scope="col">Input rounded to one digit<br></br> with `HALF_UP` rounding </th></tr></thead> * <tbody style="text-align:right"> <tr><th scope="row">5.5</th> <td>6</td> </tr> * <tr><th scope="row">2.5</th> <td>3</td> </tr> * <tr><th scope="row">1.6</th> <td>2</td> </tr> * <tr><th scope="row">1.1</th> <td>1</td> </tr> * <tr><th scope="row">1.0</th> <td>1</td> </tr> * <tr><th scope="row">-1.0</th> <td>-1</td> </tr> * <tr><th scope="row">-1.1</th> <td>-1</td> </tr> * <tr><th scope="row">-1.6</th> <td>-2</td> </tr> * <tr><th scope="row">-2.5</th> <td>-3</td> </tr> * <tr><th scope="row">-5.5</th> <td>-6</td> </tr></tbody> * </table> *