setScale
returns a new BigDecimal
with the result, it doesn’t change the instance you call it on. So assign the return value back to value
:
value = value.setScale(0, RoundingMode.UP);
Live Example
I also changed it to RoundingMode.UP
because you said you always wanted to round up. But depending on your needs, you might want RoundingMode.CEILING
instead; it depends on what you want -451.2
to become (-452
[UP
] or -451
[CEILING
]). See RoundingMode
for more.