I have a decimal number eg 65.435 or 9.2 or 10.23 , now i have to increment it as 65.436, 9.3,10.24.
Is there any utility method present for that in java?
I know we can do it by checking decimal place and then increment, but i want like in case of integer if we use '++' it increment the value.
Can anyone suggest a better way to handle.
spelling out Mr.Robot's comment:
BigDecimal bd = new BigDecimal("1.234");
bd = new BigDecimal(bd.unscaledValue().add(BigInteger.ONE), bd.scale());