Groovy web console

subscribe to the feed Subscribe
to this
site
rounding up (via #groovywebconsole)
tweet this snippet Tweet
this
script

rounding up

Published 3 months ago by kk
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
import java.math.RoundingMode

println new BigDecimal( ((int) Math.ceil(0.30*20)) / 20d).setScale(2, RoundingMode.HALF_UP)