Groovy web console

subscribe to the feed Subscribe
to this
site

getPercentageRounds

Published 2 months ago by eazybox
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
def getPercentageRounds(percentage) {
    '🔵'*(percentage*10)+ '⚪'*Math.ceil((1-percentage)*10)
}


(0..10).each{ println getPercentageRounds(it/10) }